aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-count.c
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-01-14 19:17:34 -0500
committerGravatar David Bremner <bremner@debian.org>2012-01-16 21:06:35 -0400
commit42a907992823030f070fc395a174f779998ca6f5 (patch)
treeae5024f696448426b6fadd76df888cc1421215ad /notmuch-count.c
parent3b76adf9e2c026dd03b820f4c6eab50e25444113 (diff)
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.
Diffstat (limited to 'notmuch-count.c')
-rw-r--r--notmuch-count.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/notmuch-count.c b/notmuch-count.c
index 0982f99f..f77861ee 100644
--- a/notmuch-count.c
+++ b/notmuch-count.c
@@ -35,6 +35,9 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
char *query_str;
int opt_index;
int output = OUTPUT_MESSAGES;
+ const char **auto_exclude_tags;
+ size_t auto_exclude_tags_length;
+ unsigned int i;
notmuch_opt_desc_t options[] = {
{ NOTMUCH_OPT_KEYWORD, &output, "output", 'o',
@@ -75,6 +78,11 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
return 1;
}
+ 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) {
case OUTPUT_MESSAGES:
printf ("%u\n", notmuch_query_count_messages (query));