From: Karel Zak Date: Mon, 17 Sep 2012 07:31:54 +0000 (+0200) Subject: sidebar: extend sidebar sort methods, add sort_sidebar= X-Git-Tag: neomutt-20160317~5^2~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e79d1be846297742211872b4470bba0494cdc77d;p=neomutt sidebar: extend sidebar sort methods, add sort_sidebar= sort_sidebar=(desc|path|count|new|unsorted) Signed-off-by: Karel Zak --- diff --git a/README.notmuch b/README.notmuch index 701fbb912..ba525ec3d 100644 --- a/README.notmuch +++ b/README.notmuch @@ -123,7 +123,8 @@ notmuch support for mutt virtual-mailboxes [ ...] This command specifies one or more virtual folder. The folders are - accessioble by command 'X'. + accessible by command 'X'. It's possible to use the virtual mailbox + description as a sort key (e.g set sort_sidebar=desc) example: @@ -245,6 +246,7 @@ notmuch support for mutt # sidebar set sidebar_width = 35 set sidebar_visible = yes + set sort_sidebar = unsorted color sidebar_new yellow default bind index sidebar-prev bind index sidebar-next diff --git a/init.h b/init.h index 8df5bfbea..dd2835272 100644 --- a/init.h +++ b/init.h @@ -3178,14 +3178,15 @@ struct option_t MuttVars[] = { { "sort_re", DT_BOOL, R_INDEX|R_RESORT|R_RESORT_INIT, OPTSORTRE, 1 }, /* ** .pp - ** This variable is only useful when sorting by threads with - ** $$strict_threads \fIunset\fP. In that case, it changes the heuristic - ** mutt uses to thread messages by subject. With $$sort_re \fIset\fP, mutt will - ** only attach a message as the child of another message by subject if - ** the subject of the child message starts with a substring matching the - ** setting of $$reply_regexp. With $$sort_re \fIunset\fP, mutt will attach - ** the message whether or not this is the case, as long as the - ** non-$$reply_regexp parts of both messages are identical. + ** This variable is only useful when sorting by mailboxes in sidebar. By default, + ** entries are unsorted. Valid values: + ** .il + ** .dd count (all message count) + ** .dd desc (virtual mailbox description) + ** .dd new (new message count) + ** .dd path + ** .dd unsorted + ** .ie */ { "spam_separator", DT_STR, R_NONE, UL &SpamSep, UL "," }, /* @@ -3812,6 +3813,7 @@ const struct mapping_t SortKeyMethods[] = { const struct mapping_t SortSidebarMethods[] = { { "count", SORT_COUNT }, + { "desc", SORT_DESC }, { "flagged", SORT_FLAGGED }, { "new", SORT_COUNT_NEW }, { "path", SORT_PATH }, diff --git a/sidebar.c b/sidebar.c index 35aeb6f89..714795a1f 100644 --- a/sidebar.c +++ b/sidebar.c @@ -363,6 +363,9 @@ cb_qsort_buffy (const void *a, const void *b) case SORT_COUNT_NEW: result = (b2->msg_unread - b1->msg_unread); break; + case SORT_DESC: + result = mutt_strcmp (b1->desc, b2->desc); + break; case SORT_FLAGGED: result = (b2->msg_flagged - b1->msg_flagged); break;