From: Karel Zak Date: Tue, 3 Jan 2012 11:36:44 +0000 (+0100) Subject: improve nm_unread_tag setting X-Git-Tag: neomutt-20160404~13^2~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ff2fd436cfff0b1cd644342d94720bbc2455ed5;p=neomutt improve nm_unread_tag setting Signed-off-by: Karel Zak --- diff --git a/README.notmuch b/README.notmuch index cd7a1ee1d..c8c4c5c9b 100644 --- a/README.notmuch +++ b/README.notmuch @@ -114,13 +114,13 @@ notmuch support for mutt Default is "unread,draft,flagged,passed,replied,attachment". - notmuch_unread_tag = tag: + notmuch_unread_tag = This variable specifies notmuch tag which is used for unread messages. The variable is used to count unread messages in DB only. All other mutt commands use standard (e.g. maildir) flags. - Default is "tag:unread". + Default is "unread". vfolder_format = diff --git a/init.h b/init.h index e32c4c518..485acd150 100644 --- a/init.h +++ b/init.h @@ -1682,7 +1682,7 @@ struct option_t MuttVars[] = { ** This variable specifies private notmuch tags which should not be printed ** on screen. */ - { "nm_unread_tag", DT_STR, R_NONE, UL &NotmuchUnreadTag, UL "tag:unread" }, + { "nm_unread_tag", DT_STR, R_NONE, UL &NotmuchUnreadTag, UL "unread" }, /* ** .pp ** This variable specifies notmuch tag which is used for unread messages. The diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 84d9ca5fc..2f2140774 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -886,14 +886,14 @@ int nm_get_count(char *path, unsigned *all, unsigned *new) *new = all ? *all : count_query(db, db_query); else { size_t qsz = strlen(db_query) - + sizeof(" and ") + + sizeof(" and tag:") + strlen(NotmuchUnreadTag); char *qstr = safe_malloc(qsz + 10); if (!qstr) goto done; - snprintf(qstr, qsz, "%s and %s", db_query, NotmuchUnreadTag); + snprintf(qstr, qsz, "%s and tag:%s", db_query, NotmuchUnreadTag); *new = count_query(db, qstr); FREE(&qstr); }