changeset: 6907:b57c695b7923
user:      Kevin McCarthy <[email protected]>
date:      Thu Jan 19 14:58:13 2017 -0800
link:      http://dev.mutt.org/hg/mutt/rev/b57c695b7923

Fix sidebar references to the "new count" to be "unread". (closes #3908)

%N in $sidebar_format and "new"in $sidebar_sort_method actually use
the unread message count.  Update the documentation to mention that.

Add an "unread" method to $sidebar_sort_method, but preserve "new" for
compatibility.

Change the SORT_COUNT_NEW constant to SORT_UNREAD, so the code is also
consistent with the meaning.

Thanks to cri for reporting the problem and suggesting where to fix it
in the code.

diffs (90 lines):

diff -r a555ada578b8 -r b57c695b7923 doc/manual.xml.head
--- a/doc/manual.xml.head       Tue Jan 17 16:09:16 2017 -0800
+++ b/doc/manual.xml.head       Thu Jan 19 14:58:13 2017 -0800
@@ -8465,13 +8465,17 @@
          </row>
          <row>
            <entry><literal>new</literal></entry>
-           <entry>Number of new messages</entry>
+           <entry>Number of unread messages</entry>
          </row>
          <row>
            <entry><literal>path</literal></entry>
            <entry>Alphabetically by path</entry>
          </row>
          <row>
+           <entry><literal>unread</literal></entry>
+           <entry>Number of unread messages</entry>
+         </row>
+         <row>
            <entry><literal>unsorted</literal></entry>
            <entry>Do not resort the paths</entry>
          </row>
diff -r a555ada578b8 -r b57c695b7923 init.h
--- a/init.h    Tue Jan 17 16:09:16 2017 -0800
+++ b/init.h    Thu Jan 19 14:58:13 2017 -0800
@@ -2757,7 +2757,7 @@
   ** .dl
   ** .dt %B  .dd Name of the mailbox
   ** .dt %S  .dd * Size of mailbox (total number of messages)
-  ** .dt %N  .dd * Number of New messages in the mailbox
+  ** .dt %N  .dd * Number of unread messages in the mailbox
   ** .dt %n  .dd N if mailbox has new mail, blank otherwise
   ** .dt %F  .dd * Number of Flagged messages in the mailbox
   ** .dt %!  .dd ``!'' : one flagged message;
@@ -2828,7 +2828,10 @@
   ** .dd alpha (alphabetically)
   ** .dd count (all message count)
   ** .dd flagged (flagged message count)
-  ** .dd new (new message count)
+  ** .dd name (alphabetically)
+  ** .dd new (unread message count)
+  ** .dd path (alphabetically)
+  ** .dd unread (unread message count)
   ** .dd unsorted
   ** .ie
   ** .pp
@@ -3862,8 +3865,9 @@
   { "flagged",         SORT_FLAGGED },
   { "mailbox-order",   SORT_ORDER },
   { "name",            SORT_PATH },
-  { "new",             SORT_COUNT_NEW },
+  { "new",             SORT_UNREAD },  /* kept for compatibility */
   { "path",            SORT_PATH },
+  { "unread",          SORT_UNREAD },
   { "unsorted",                SORT_ORDER },
   { NULL,              0 }
 };
diff -r a555ada578b8 -r b57c695b7923 sidebar.c
--- a/sidebar.c Tue Jan 17 16:09:16 2017 -0800
+++ b/sidebar.c Thu Jan 19 14:58:13 2017 -0800
@@ -260,7 +260,7 @@
     case SORT_COUNT:
       result = (b2->msg_count - b1->msg_count);
       break;
-    case SORT_COUNT_NEW:
+    case SORT_UNREAD:
       result = (b2->msg_unread - b1->msg_unread);
       break;
     case SORT_FLAGGED:
@@ -363,7 +363,7 @@
 
   /* These are the only sort methods we understand */
   if ((ssm == SORT_COUNT)     ||
-      (ssm == SORT_COUNT_NEW) ||
+      (ssm == SORT_UNREAD)    ||
       (ssm == SORT_FLAGGED)   ||
       (ssm == SORT_PATH))
     qsort (Entries, EntryCount, sizeof (*Entries), cb_qsort_sbe);
diff -r a555ada578b8 -r b57c695b7923 sort.h
--- a/sort.h    Tue Jan 17 16:09:16 2017 -0800
+++ b/sort.h    Thu Jan 19 14:58:13 2017 -0800
@@ -32,7 +32,7 @@
 #define SORT_TRUST     13
 #define SORT_SPAM      14
 #define SORT_COUNT     15
-#define SORT_COUNT_NEW 16
+#define SORT_UNREAD    16
 #define SORT_FLAGGED   17
 #define SORT_PATH      18
 

Reply via email to