diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-06-28 21:51:11 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-06-28 21:51:11 -0600 |
commit | 8c0d2a658c5c41f2be062dad11c4deeb6274802f (patch) | |
tree | 5cd8224931ad7a3e60844a8ac58110ac67df0718 | |
parent | 33d28e5ec670e974d555bcee34a631d878fda84c (diff) | |
download | alpine-8c0d2a658c5c41f2be062dad11c4deeb6274802f.tar.xz |
* When messages are selected, pressing the ";" command to broaden or narrow
a search, now offers the possibility to completely replace the search, and
is almost equivalent to being a shortcut to "unselect all messages, and select
again". The difference is that cancelling this command will not unselect
all currently selected messages. Suggested by Holger Trapp.
-rw-r--r-- | alpine/mailcmd.c | 17 | ||||
-rw-r--r-- | pith/pine.hlp | 6 |
2 files changed, 22 insertions, 1 deletions
diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c index e26495ed..8c94aa48 100644 --- a/alpine/mailcmd.c +++ b/alpine/mailcmd.c @@ -132,6 +132,7 @@ ESCKEY_S sel_opts1[] = { {'b', 'b', "B", N_("Broaden selctn")}, {'n', 'n', "N", N_("Narrow selctn")}, {'f', 'f', "F", N_("Flip selected")}, + {'r', 'r', "R", N_("Replace selctn")}, {-1, 0, NULL, NULL} }; @@ -6921,7 +6922,7 @@ int aggregate_select(struct pine *state, MSGNO_S *msgmap, int q_line, CmdWhere in_index) { long i, diff, old_tot, msgno, raw; - int q = 0, rv = 0, narrow = 0, hidden, ret = -1; + int p = 0, q = 0, rv = 0, narrow = 0, hidden, ret = -1; ESCKEY_S *sel_opts; MESSAGECACHE *mc; SEARCHSET *limitsrch = NULL; @@ -6998,6 +6999,9 @@ aggregate_select(struct pine *state, MSGNO_S *msgmap, int q_line, CmdWhere in_in case 'n' : /* narrow selection */ narrow++; + case 'r' : /* replace selection */ + p = 1; /* set flag we want to replace */ + sel_opts -= 2; /* re-enable first two options */ case 'b' : /* broaden selection */ q = 0; /* offer criteria prompt */ break; @@ -7032,6 +7036,17 @@ aggregate_select(struct pine *state, MSGNO_S *msgmap, int q_line, CmdWhere in_in } } + /* When we are replacing the search, unselect all messages first, unless + * we are cancelling, in whose case, leave the screen as is, because we + * are cancelling! + */ + if(p == 1 && q != 'x'){ + msgno = any_lflagged(msgmap, MN_SLCT); + diff = (!msgno) ? mn_get_total(msgmap) : 0L; + agg_select_all(state->mail_stream, msgmap, &diff, + any_lflagged(msgmap, MN_SLCT) <= 0L); + } + /* * The purpose of this is to add the appropriate searchset to the * search so that the search can be limited to only looking at what diff --git a/pith/pine.hlp b/pith/pine.hlp index 84cfe722..578d0a20 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -199,6 +199,12 @@ problems you find with this release. asks the user which client-id to use and associates that client-id to the credentials in the XOAUTH2 configuration screen. <A HREF="h_xoauth2_config_screen">Learn more</A>. + +<LI> When messages are selected, pressing the ";" command to broaden or narrow + a search, now offers the possibility to completely replace the search, and + is almost equivalent to being a shortcut to "unselect all messages, and select + again". The difference is that cancelling this command will not unselect + all currently selected messages. Suggested by Holger Trapp. </UL> <P> |