[PATCH v2 3/3] search: Support automatic tag exclusions

David Edmondson dme at dme.org
Wed Jan 18 00:38:23 PST 2012


On Tue, 17 Jan 2012 15:32:11 -0500, Austin Clements <amdragon at MIT.EDU> wrote:
> 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)

I'm not sure, as I haven't looked at the configuration code at
all, sorry.

Something must create the initial configuration file if none exists. I'd
be okay with that code adding 'deleted' and 'spam' to the excluded list.

This would mean that an existing user would see no change without taking
some action (adding the tags to the configuration file) and a new user
would see the new behaviour (automatic exclusion).

I'm not completely sure that automatically adding the exclusion of the
specified tags via the configuration file for new users is a great
idea. It seems as though it will lead to confusion for someone at some
point.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120118/c35a4c1c/attachment.pgp>


More information about the notmuch mailing list