[PATCH v2 3/3] search: Support automatic tag exclusions
Austin Clements
amdragon at MIT.EDU
Tue Jan 17 12:32:11 PST 2012
Quoth David Edmondson on Jan 17 at 9:08 am:
> On Mon, 16 Jan 2012 15:16:24 -0700, Jeremy Nickurak <jeremy at nickurak.ca> wrote:
> > On Mon, Jan 16, 2012 at 12:28, Austin Clements <amdragon at mit.edu> wrote:
> > >> Having "deleted" and "spam" as default settings in the configuration
> > >> file might be more reasonable.
> >
> > If I read correctly:
> >
> > 1) If no exclude options are in the config file, none should be used.
>
> Yes.
>
> > 2) On notmuch setup, "deleted" and "spam" should be added to .notmuch-config
>
> I might argue between 'should' and 'could', but the sense is correct.
Oh, I think I see. I don't know if I can do precisely that, since the
config code doesn't know if it's being called from setup, but is
something like this essentially what you're suggesting?
if (notmuch_config_get_auto_exclude_tags (config, &tmp) == NULL) {
if (is_new) {
const char *tags[] = { "deleted", "spam" };
notmuch_config_set_auto_exclude_tags (config, tags, 2);
} else {
notmuch_config_set_auto_exclude_tags (config, NULL, 0);
}
}
(where is_new is TRUE if this is a brand-new config file)
More information about the notmuch
mailing list