From: Kirill A. Shutemov Date: Thu, 10 Oct 2013 18:34:57 +0000 (-0700) Subject: make %N optional for notmuch browser format X-Git-Tag: neomutt-20160404~13^2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb43c52e5dadd9f8d166397d730b7099ff319d04;p=neomutt make %N optional for notmuch browser format It will allow to have vfolder_format option like this: set vfolder_format="%?N?*& ?%20f %6N %10n" This format will mark all vfolders with new messages with '*': inbox 0 0 * linux/mm 2 183 linux/mm/commits 0 39 ... Without the patch all vforlders will be marked. Signed-off-by: Kirill A. Shutemov --- diff --git a/browser.c b/browser.c index 8a7dbad4d..2617c380c 100644 --- a/browser.c +++ b/browser.c @@ -336,8 +336,12 @@ folder_format_str (char *dest, size_t destlen, size_t col, char op, const char * #ifdef USE_NOTMUCH if (mx_is_notmuch (folder->ff->name)) { - snprintf (tmp, sizeof (tmp), "%%%sd", fmt); - snprintf (dest, destlen, tmp, folder->ff->new); + if (!optional) + { + snprintf (tmp, sizeof (tmp), "%%%sd", fmt); + snprintf (dest, destlen, tmp, folder->ff->new); + } else if (!folder->ff->new) + optional = 0; break; } #endif