[PATCH] Automatically exclude tags in notmuch-show

Mark Walters markwalters1009 at gmail.com
Thu Jan 19 14:03:03 PST 2012


Add the use of auto_exclude_tags in notmuch-show.c.  As with Austin's
patch (commit 42a907992823030f070fc395a174f779998ca6f5) it just adds
the excluded tags to the query so the excluded messages will still
appear in the emacs interface, but as a single header line rather than
as a matching message.
---
 notmuch-show.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index d14dac9..925dfd6 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -948,9 +948,12 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
     char *opt;
     const notmuch_show_format_t *format = &format_text;
     notmuch_show_params_t params;
+    const char **auto_exclude_tags;
+    size_t auto_exclude_tags_length;
     int mbox = 0;
     int format_specified = 0;
     int i;
+    unsigned int j;
 
     params.entire_thread = 0;
     params.raw = 0;
@@ -1040,6 +1043,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
 	return 1;
     }
 
+    auto_exclude_tags = notmuch_config_get_auto_exclude_tags
+        (config, &auto_exclude_tags_length);
+    for (j = 0; j < auto_exclude_tags_length; j++)
+        notmuch_query_add_tag_exclude (query, auto_exclude_tags[j]);
+
     /* if part was requested and format was not specified, use format=raw */
     if (params.part >= 0 && !format_specified)
 	format = &format_raw;
-- 
1.7.2.3



More information about the notmuch mailing list