From: Kevin McCarthy Date: Sat, 11 Nov 2017 23:49:15 +0000 (-0800) Subject: Add $change_folder_next option to control mailbox suggestion order. X-Git-Tag: mutt-1-10-rel~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=610c6b0aca8f790bebb813f4fa63d20373d562b5;p=mutt Add $change_folder_next option to control mailbox suggestion order. This patch is out of the Gentoo package maintained by Fabian Groffen. From the link below, it appears the original author was Simon Burge. I made some minor changes to get it to apply correctly, and cleaned up the documentation a bit. Original patch description: This patch brings back the original behaviour of change-folder, which some people find more useful. It suggests the next folder in your mailboxes list that has new mail measured from the current folder, instead of the first folder from your mailboxes list in any case. This prevents starvation of folders defined at the back of your list ;) See discussion: http://thread.gmane.org/gmane.mail.mutt.devel/12457 --- diff --git a/curs_main.c b/curs_main.c index 1a1279e9..19e39051 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1213,6 +1213,11 @@ int mutt_index_menu (void) #endif else { + if (option (OPTCHANGEFOLDERNEXT) && Context && Context->path) + { + strfcpy (buf, Context->path, sizeof (buf)); + mutt_pretty_mailbox (buf, sizeof (buf)); + } mutt_buffy (buf, sizeof (buf)); if (mutt_enter_fname (cp, buf, sizeof (buf), 1) == -1) diff --git a/init.h b/init.h index 4d6d0e0d..13505a21 100644 --- a/init.h +++ b/init.h @@ -361,6 +361,13 @@ struct option_t MuttVars[] = { ** */ #endif + { "change_folder_next", DT_BOOL, R_NONE, OPTCHANGEFOLDERNEXT, 0 }, + /* + ** .pp + ** When this variable is \fIset\fP, the \fC\fP function + ** mailbox suggestion will start at the next folder in your ``$mailboxes'' + ** list, instead of starting at the first folder in the list. + */ { "charset", DT_STR, R_NONE, UL &Charset, UL 0 }, /* ** .pp diff --git a/mutt.h b/mutt.h index 95767089..e619353e 100644 --- a/mutt.h +++ b/mutt.h @@ -355,6 +355,7 @@ enum OPTBEEP, OPTBEEPNEW, OPTBOUNCEDELIVERED, + OPTCHANGEFOLDERNEXT, OPTBRAILLEFRIENDLY, OPTCHECKMBOXSIZE, OPTCHECKNEW,