mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
Make exclusion visible again
This revertsdfee0f9
man: remove search.exclude_tags from notmuch-config.1 for 0.12e83409d
NEWS: revert NEWS item for exclude tags for 0.12e77b031
config: disable addition of exclude tags for 0.12
This commit is contained in:
parent
ad6a6edb38
commit
4b3af0e444
4 changed files with 46 additions and 2 deletions
18
NEWS
18
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
|
||||
|
|
|
@ -83,6 +83,14 @@ will be ignored, regardless of the location in the mail store
|
|||
directory hierarchy.
|
||||
.RE
|
||||
|
||||
.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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue