diff options
author | Pieter Praet <pieter@praet.org> | 2012-01-23 05:22:34 +0100 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-01-23 19:21:18 -0400 |
commit | ba33a15ec3ab80b175cf54d2584aa8acd1a2dc6e (patch) | |
tree | 85bb31d0db34ed6fec7416131aba1aea6a042fd6 /notmuch-config.c | |
parent | 6795c62a50815786fd168536371cf6b9ed817535 (diff) |
config: only exclude messages if 'search.exclude_tags' is explicitly set
Currently, the 'search.exclude_tags' option is automatically
set to "deleted;spam;" if it's missing from the config file.
This violates the Principle of Least Surprise, so *only* set
'search.exclude_tags' to "deleted;spam;" if we didn't find a
configuration file at all.
This patch is actually Austin Clements' work:
id:"20120117203211.GQ16740@mit.edu"
Diffstat (limited to 'notmuch-config.c')
-rw-r--r-- | notmuch-config.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/notmuch-config.c b/notmuch-config.c index 39da8889..0ded6d73 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -362,8 +362,12 @@ notmuch_config_open (void *ctx, } if (notmuch_config_get_search_exclude_tags (config, &tmp) == NULL) { - const char *tags[] = { "deleted", "spam" }; - notmuch_config_set_search_exclude_tags (config, tags, 2); + if (is_new) { + const char *tags[] = { "deleted", "spam" }; + notmuch_config_set_search_exclude_tags (config, tags, 2); + } else { + notmuch_config_set_search_exclude_tags (config, NULL, 0); + } } error = NULL; |