]> granicus.if.org Git - neomutt/commitdiff
Add $browser_abbreviate_mailboxes.
authorKevin McCarthy <kevin@8t8.us>
Thu, 19 Apr 2018 20:51:07 +0000 (13:51 -0700)
committerRichard Russon <rich@flatcap.org>
Thu, 19 Apr 2018 20:51:07 +0000 (13:51 -0700)
This allows '=' and '~' mailboxes shortcuts to be turned off in the
browser mailbox list.

The default $sort_browser value of "alpha" uses strcoll(3), which
ignores some punctuation.  When using multiple accounts with
dynamically changing values of $folder, this can lead to an
unintuitive sorting order.  (See issue #22 for an example.)

This problem came about because of commit 8328ce68, which enabled
mutt_pretty_mailbox() calls for IMAP and POP mailboxes too.  The
commit had a valid point about consistency and too-wide mailbox
listings, so I don't really want to revert it.

This option provides an alternative to completely enable/disable the
shortcuts for those who run into an issue.

browser.c
init.h
options.h

index 5f1b647fefded86cee76ed07804ce645fb5f5d70..e1e29b0947ef99634fe06f003c20680693855c66 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -889,7 +889,8 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state)
 
       char buffer[LONG_STRING];
       mutt_str_strfcpy(buffer, tmp->path, sizeof(buffer));
-      mutt_pretty_mailbox(buffer, sizeof(buffer));
+      if (BrowserAbbreviateMailboxes)
+        mutt_pretty_mailbox(buffer, sizeof(buffer));
 
 #ifdef USE_IMAP
       if (mx_is_imap(tmp->path))
diff --git a/init.h b/init.h
index 37e43ebbab52034c6f13bbbf4a79aa6ac088275d..0eda8ca3799166cf4c487dcd31dba49fc75c26af 100644 (file)
--- a/init.h
+++ b/init.h
@@ -380,6 +380,19 @@ struct Option MuttVars[] = {
   ** follow these menus.  The option is \fIunset\fP by default because many
   ** visual terminals don't permit making the cursor invisible.
   */
+  { "browser_abbreviate_mailboxes", DT_BOOL, R_NONE, &BrowserAbbreviateMailboxes, 1 },
+  /*
+  ** .pp
+  ** When this variable is \fIset\fP, mutt will abbreviate mailbox
+  ** names in the browser mailbox list, using '~' and '='
+  ** shortcuts.
+  ** .pp
+  ** The default \fC"alpha"\fP setting of $$sort_browser uses
+  ** locale-based sorting (using \fCstrcoll(3)\fP), which ignores some
+  ** punctuation.  This can lead to some situations where the order
+  ** doesn't make intuitive sense.  In those cases, it may be
+  ** desirable to \fIunset\fP this variable.
+  */
 #ifdef USE_NNTP
   { "catchup_newsgroup", DT_QUAD, R_NONE, &CatchupNewsgroup, MUTT_ASKYES },
   /*
index 892763b7e89c72005a31ee661ea35d2e23aa10ff..41c4f116c9985d0fc56096e293f940d9aa7ba01d 100644 (file)
--- a/options.h
+++ b/options.h
@@ -76,6 +76,7 @@ WHERE bool Beep;
 WHERE bool BeepNew;
 WHERE bool BounceDelivered;
 WHERE bool BrailleFriendly;
+WHERE bool BrowserAbbreviateMailboxes;
 WHERE bool ChangeFolderNext;
 WHERE bool CheckMboxSize;
 WHERE bool CheckNew;