From c2fba77b22d68aa038ab78f78c17004c88401362 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Wed, 7 Sep 2016 16:21:08 +0100 Subject: [PATCH] notmuch: sync vfolder_format to folder_format The expandos used by NotMuch's vfolder_format didn't match those of Mutt's folder_format. This caused confusion. vfolder_format expandos: %C current file number %f folder name (description) %m number of messages in the mailbox * %n number of unread messages in the mailbox * %N N if mailbox has new mail, blank otherwise Default setting: set vfolder_format = "%2C %N %?n?%4n/& ?%4m %f" --- README.notmuch | 11 +++---- browser.c | 12 -------- doc/manual.xml.head | 70 ++++++++++++++++++++++++++++++++++++++++++--- init.h | 16 ++--------- 4 files changed, 75 insertions(+), 34 deletions(-) diff --git a/README.notmuch b/README.notmuch index b1067277b..a36d1b2ae 100644 --- a/README.notmuch +++ b/README.notmuch @@ -261,17 +261,18 @@ notmuch support for mutt vfolder_format = This variable allows you to customize the file browser display for virtual - folders to your personal taste. This string is similar to $index_format, - but has its own set of printf(3)-like sequences: + folders to your personal taste. This string is similar to $folder_format, + %C current folder number %f folder name (description) - %n number of all messages - %N number of new messages + %m number of messages in the mailbox * + %n number of unread messages in the mailbox * + %N N if mailbox has new mail, blank otherwise %>X right justify the rest of the string and pad with character ``X'' %|X pad to the end of the line with character ``X'' %*X soft-fill with character ``X'' as pad - Default is "%6n(%6N) %f ". + Default is "%2C %?n?%4n/& ?%4m %N %f" index_format and pager_format diff --git a/browser.c b/browser.c index ea3dcf696..83d899443 100644 --- a/browser.c +++ b/browser.c @@ -380,18 +380,6 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co break; case 'N': -#ifdef USE_NOTMUCH - if (mx_is_notmuch (folder->ff->name)) - { - if (!optional) - { - snprintf (tmp, sizeof (tmp), "%%%sd", fmt); - snprintf (dest, destlen, tmp, folder->ff->new); - } else if (!folder->ff->new) - optional = 0; - break; - } -#endif snprintf (tmp, sizeof (tmp), "%%%sc", fmt); snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : ' '); break; diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 11d3612f0..c08759e42 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -11795,7 +11795,6 @@ bind index \CG get-message Dependencies: mutt-1.7.0 - sidebar patch quasi-delete patch index-color patch Notmuch libraries @@ -11915,6 +11914,69 @@ virtual-mailboxes "My INBOX" "notmuch://?query=tag:inbox" + + Format String for the NotMuch Browser + + + Default: %2C %?n?%4n/& ?%4m %f + + + + This variable allows you to customize the browser display to your personal taste. + This string is similar to $index_format, but has + its own set of printf(3)-like sequences: + + + + + + + %C + current file number + + + %f + folder name (description) + + + %m + number of messages in the mailbox * + + + %n + number of unread messages in the mailbox * + + + %N + N if mailbox has new mail, blank otherwise + + + %>X + right justify the rest of the string and pad with character + X + + + %|X + pad to the end of the line with character + X + + + %*X + soft-fill with character + Xas pad + + + + + + + For an explanation of soft-fill, see the $index_format documentation. + + + + * = can be optionally printed if nonzero + + @@ -12159,8 +12221,8 @@ set nm_hidden_tags = "unread,draft,flagged,passed,replied,attachment,signed,encr # This option specifies timeout for Notmuch database. Default is 5 seconds. set nm_open_timeout = 5 -# This variable specifies notmuch query type, supported types: 'threads' and -# 'messages'. +# This variable specifies notmuch query type, supported types: 'threads' and +# 'messages'. set nm_query_type = messages # Add messages stored to the mutt record (see $record in the mutt docs) @@ -12175,7 +12237,7 @@ set nm_unread_tag = unread # This variable allows you to customize the file browser display for virtual # folders to your personal taste. -set vfolder_format = "%6n(%6N) %f" +set vfolder_format = "%2C %?n?%4n/& ?%4m %N %f" # When set, mutt will use the first virtual mailbox (see virtual-mailboxes) # as a spoolfile. diff --git a/init.h b/init.h index 0656a5bb9..d0296a155 100644 --- a/init.h +++ b/init.h @@ -4021,22 +4021,12 @@ struct option_t MuttVars[] = { ** given in the built-in editor. */ #ifdef USE_NOTMUCH - { "vfolder_format", DT_STR, R_INDEX, UL &VirtFolderFormat, UL " %6n(%6N) %f " }, + { "vfolder_format", DT_STR, R_INDEX, UL &VirtFolderFormat, UL "%2C %?n?%4n/& ?%4m %f" }, /* ** .pp ** This variable allows you to customize the file browser display for virtual - ** folders to your ** personal taste. This string is similar to $$index_format, - ** but has its own set of \fCprintf(3)\fP-like sequences: - ** .dl - ** .dt %f .dd folder name (description) - ** .dt %n .dd number of all messages - ** .dt %N .dd number of new messages - ** .dt %>X .dd right justify the rest of the string and pad with character ``X'' - ** .dt %|X .dd pad to the end of the line with character ``X'' - ** .dt %*X .dd soft-fill with character ``X'' as pad - ** .de - ** .pp - ** For an explanation of ``soft-fill'', see the $$index_format documentation. + ** folders to your personal taste. This string uses many of the same + ** expandos as $$folder_format. */ { "virtual_spoolfile", DT_BOOL, R_NONE, OPTVIRTSPOOLFILE, 0 }, /* -- 2.40.0