aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar David Bremner <bremner@debian.org>2012-03-03 08:56:15 -0400
committerGravatar David Bremner <bremner@debian.org>2012-03-03 11:56:47 -0400
commit4b3af0e4443f88f302f09a7a6099a31103d862d6 (patch)
tree09faebca5b0705650751c066502be18ab753d52d
parentad6a6edb38e428f7bbcd81b49fd2ef1e5197f8c7 (diff)
Make exclusion visible again
This reverts dfee0f9 man: remove search.exclude_tags from notmuch-config.1 for 0.12 e83409d NEWS: revert NEWS item for exclude tags for 0.12 e77b031 config: disable addition of exclude tags for 0.12
-rw-r--r--NEWS18
-rw-r--r--man/man1/notmuch-config.18
-rw-r--r--notmuch-config.c3
-rw-r--r--notmuch-setup.c19
4 files changed, 46 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 4152e7c9..a7399149 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,24 @@ Reply to sender
to all. The feature is available through the new command line option
--reply-to=(all|sender).
+Tag exclusion
+
+ Tags can be automatically excluded from search results by adding them
+ to the new 'search.exclude_tags' option in the Notmuch config file.
+
+ This behaviour can be overridden by explicitly including an excluded
+ tag in your query, for example:
+
+ notmuch search $your_query and tag:$excluded_tag
+
+ Existing users will probably want to run "notmuch setup" again to add
+ the new well-commented [search] section to the configuration file.
+
+ For new configurations, accepting the default setting will cause the
+ tags "deleted" and "spam" to be excluded, equivalent to running:
+
+ notmuch config set search.exclude_tags deleted spam
+
Mail store folder/file ignore
A new configuration option, `new.ignore`, lets users specify a
diff --git a/man/man1/notmuch-config.1 b/man/man1/notmuch-config.1
index 57eee93b..e62577cc 100644
--- a/man/man1/notmuch-config.1
+++ b/man/man1/notmuch-config.1
@@ -85,6 +85,14 @@ directory hierarchy.
.RS 4
.TP 4
+.B search.exclude_tags
+A list of tags that will be excluded from search results by
+default. Using an excluded tag in a query will override that
+exclusion.
+.RE
+
+.RS 4
+.TP 4
.B maildir.synchronize_flags
If true, then the following maildir flags (in message filenames) will
be synchronized with the corresponding notmuch tags:
diff --git a/notmuch-config.c b/notmuch-config.c
index 61fda3ea..e9b27509 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -377,7 +377,8 @@ notmuch_config_open (void *ctx,
if (notmuch_config_get_search_exclude_tags (config, &tmp) == NULL) {
if (is_new) {
- /* We do not set default search_exclude_tags for 0.12 */
+ const char *tags[] = { "deleted", "spam" };
+ notmuch_config_set_search_exclude_tags (config, tags, 2);
} else {
notmuch_config_set_search_exclude_tags (config, NULL, 0);
}
diff --git a/notmuch-setup.c b/notmuch-setup.c
index 307231d5..94d0aa7b 100644
--- a/notmuch-setup.c
+++ b/notmuch-setup.c
@@ -133,6 +133,8 @@ notmuch_setup_command (unused (void *ctx),
int is_new;
const char **new_tags;
size_t new_tags_len;
+ const char **search_exclude_tags;
+ size_t search_exclude_tags_len;
#define prompt(format, ...) \
do { \
@@ -209,7 +211,22 @@ notmuch_setup_command (unused (void *ctx),
}
- /* Temporarily remove exclude tag support for 0.12 */
+ search_exclude_tags = notmuch_config_get_search_exclude_tags (config, &search_exclude_tags_len);
+
+ printf ("Tags to exclude when searching messages (separated by spaces) [");
+ print_tag_list (search_exclude_tags, search_exclude_tags_len);
+ prompt ("]: ");
+
+ if (strlen (response)) {
+ GPtrArray *tags = parse_tag_list (ctx, response);
+
+ notmuch_config_set_search_exclude_tags (config,
+ (const char **) tags->pdata,
+ tags->len);
+
+ g_ptr_array_free (tags, TRUE);
+ }
+
if (! notmuch_config_save (config)) {
if (is_new)