From: Kevin McCarthy Date: Thu, 19 Jan 2017 22:58:13 +0000 (-0800) Subject: Fix sidebar references to the "new count" to be "unread". (closes #3908) X-Git-Tag: mutt-1-8-rel~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=753de4f05ff4f8787cbac057031e4a8e48fa2092;p=mutt 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. --- diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 4a475159..4a99f3de 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -8465,12 +8465,16 @@ please have a look at the mixmaster documentation. new - Number of new messages + Number of unread messages path Alphabetically by path + + unread + Number of unread messages + unsorted Do not resort the paths diff --git a/init.h b/init.h index 6d23e2d5..6734ded4 100644 --- a/init.h +++ b/init.h @@ -2757,7 +2757,7 @@ struct option_t MuttVars[] = { ** .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 @@ struct option_t MuttVars[] = { ** .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 @@ const struct mapping_t SortSidebarMethods[] = { { "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 --git a/sidebar.c b/sidebar.c index 2afbbb32..a7abbe71 100644 --- a/sidebar.c +++ b/sidebar.c @@ -260,7 +260,7 @@ static int cb_qsort_sbe (const void *a, const void *b) 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 @@ static void sort_entries (void) /* 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 --git a/sort.h b/sort.h index 0706261e..9b87af96 100644 --- a/sort.h +++ b/sort.h @@ -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