Commit 753de4f0 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

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.
parent 851b549d
......@@ -8465,12 +8465,16 @@ please have a look at the mixmaster documentation.
</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>
......
......@@ -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 }
};
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment