From 42a907992823030f070fc395a174f779998ca6f5 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 14 Jan 2012 19:17:34 -0500 Subject: search: Support automatic tag exclusions This adds a "search" section to the config file and an "auto_tag_exclusions" setting in that section. The search and count commands pass tag tags from the configuration to the library. --- notmuch-search.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'notmuch-search.c') diff --git a/notmuch-search.c b/notmuch-search.c index 4baab561..8867aabc 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -423,6 +423,9 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) output_t output = OUTPUT_SUMMARY; int offset = 0; int limit = -1; /* unlimited */ + const char **auto_exclude_tags; + size_t auto_exclude_tags_length; + unsigned int i; enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT } format_sel = NOTMUCH_FORMAT_TEXT; @@ -490,6 +493,11 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) notmuch_query_set_sort (query, sort); + auto_exclude_tags = notmuch_config_get_auto_exclude_tags + (config, &auto_exclude_tags_length); + for (i = 0; i < auto_exclude_tags_length; i++) + notmuch_query_add_tag_exclude (query, auto_exclude_tags[i]); + switch (output) { default: case OUTPUT_SUMMARY: -- cgit v1.2.3