]> granicus.if.org Git - mutt/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)
committerKevin McCarthy <kevin@8t8.us>
Sat, 11 Nov 2017 23:49:15 +0000 (15:49 -0800)
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
mutt.h

index 1a1279e995a19c02fcf826aee5683376f0c3c36f..19e39051995bb557645465fbb0dfa388cd51716c 100644 (file)
@@ -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 4d6d0e0d28629e3d89b97c7b6a254a47635f95fa..13505a2132e5bb7d24368843a0ec7db79e32eb4f 100644 (file)
--- 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<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_STR,  R_NONE, UL &Charset, UL 0 },
   /*
   ** .pp
diff --git a/mutt.h b/mutt.h
index 9576708974523bd5046e7a4e0afd1fa0cc83cda0..e619353ebf67b83eece013b062aaa842c87f0c25 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -355,6 +355,7 @@ enum
   OPTBEEP,
   OPTBEEPNEW,
   OPTBOUNCEDELIVERED,
+  OPTCHANGEFOLDERNEXT,
   OPTBRAILLEFRIENDLY,
   OPTCHECKMBOXSIZE,
   OPTCHECKNEW,