]> granicus.if.org Git - neomutt/commitdiff
Add $change_folder_next option to control mailbox suggestion order.
authorKevin McCarthy <kevin@8t8.us>
Sat, 11 Nov 2017 23:49:15 +0000 (15:49 -0800)
committerRichard Russon <rich@flatcap.org>
Wed, 15 Nov 2017 23:16:49 +0000 (23:16 +0000)
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

curs_main.c
init.h
options.h

index a474dc46f5d5ed265e86899402a66bdd5f4cd529..97acba5d9c5a2860835f2fcf2b47dd9980dff51a 100644 (file)
@@ -2080,6 +2080,11 @@ int mutt_index_menu(void)
 #endif
         else
         {
+          if (option(OPT_CHANGE_FOLDER_NEXT) && Context && Context->path)
+          {
+            strfcpy(buf, Context->path, sizeof(buf));
+            mutt_pretty_mailbox(buf, sizeof(buf));
+          }
 #ifdef USE_NNTP
           if (op == OP_MAIN_CHANGE_GROUP || op == OP_MAIN_CHANGE_GROUP_READONLY)
           {
@@ -2096,7 +2101,7 @@ int mutt_index_menu(void)
           else
 #endif
             /* By default, fill buf with the next mailbox that contains unread
-           * mail */
+             * mail */
             mutt_buffy(buf, sizeof(buf));
 
           if (mutt_enter_fname(cp, buf, sizeof(buf), 1) == -1)
diff --git a/init.h b/init.h
index 5a341bf6dac45f94ab33ddfdb86ce2a57751789a..c6db306c8f6f0e5e57360b63e565cfdc6eaf229e 100644 (file)
--- a/init.h
+++ b/init.h
@@ -398,6 +398,13 @@ struct Option MuttVars[] = {
   **
   */
 #endif
+  { "change_folder_next", DT_BOOL, R_NONE, OPT_CHANGE_FOLDER_NEXT, 0 },
+  /*
+  ** .pp
+  ** When this variable is \fIset\fP, the \fC<change-folder>\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_STRING,  R_NONE, UL &Charset, UL 0 },
   /*
   ** .pp
index 87af4acdca895ea36a462c129da108860614bb45..b97a8e03b431003bf67a0dac3095d67c9460f726 100644 (file)
--- a/options.h
+++ b/options.h
@@ -43,6 +43,7 @@ enum GlobalBool
   OPT_BEEP_NEW,
   OPT_BOUNCE_DELIVERED,
   OPT_BRAILLE_FRIENDLY,
+  OPT_CHANGE_FOLDER_NEXT,
   OPT_CHECK_MBOX_SIZE,
   OPT_CHECK_NEW,
   OPT_COLLAPSE_ALL,