Used in index_format like this %?g?(%g)? will show nothing if there are
no notmuch labels, eg. in mixed mail setups.
Signed-off-by: David Sterba <dsterba(a)suse.cz>
---
hdrline.c | 5 ++++-
init.h | 1 +
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/hdrline.c b/hdrline.c
index 8292f58..18ca273 100644
--- a/hdrline.c
+++ b/hdrline.c
@@ -451,7 +451,10 @@ hdr_format_str (char *dest,
break;
#ifdef USE_NOTMUCH
case 'g':
- mutt_format_s (dest, destlen, prefix, nm_header_get_tags(hdr));
+ if (!optional)
+ mutt_format_s (dest, destlen, prefix, nm_header_get_tags(hdr));
+ else if (!nm_header_get_tags(hdr))
+ optional = 0;
break;
#endif
case 'H':
diff --git a/init.h b/init.h
index 886c6a3..131ee03 100644
--- a/init.h
+++ b/init.h
@@ -1256,6 +1256,7 @@ struct option_t MuttVars[] = {
** .dt %E .dd number of messages in current thread
** .dt %f .dd sender (address + real name), either From: or Return-Path:
** .dt %F .dd author name, or recipient name if the message is from you
+ ** .dt %g .dd message labels (e.g. notmuch tags)
** .dt %H .dd spam attribute(s) of this message
** .dt %i .dd message-id of the current message
** .dt %l .dd number of lines in the message (does not work with maildir,
--
1.7.6.233.gd79bc
Show replies by date
On Thu, Nov 01, 2012 at 05:33:42PM +0100, David Sterba wrote:
hdrline.c | 5 ++++-
init.h | 1 +
2 files changed, 5 insertions(+), 1 deletions(-)
Nice! Applied, thanks.
Karel
--
Karel Zak <kzak(a)redhat.com>
http://karelzak.blogspot.com