[PATCH 2/2] added support for user-specified directories to exclude

Tomi Ollila tomi.ollila at iki.fi
Fri Jan 27 02:41:18 PST 2012


On Thu, 26 Jan 2012 13:11:36 +0000, Jani Nikula <jani at nikula.org> wrote:
> On Thu, 26 Jan 2012 12:11:58 +0200, Tomi Ollila <tomi.ollila at iki.fi> wrote:
> > A new configuration key 'database.exclude' is used to determine
> > which directories user wants not to be scanned for new mails.
> > 
> > ---
> > 
> > Notes (from 2011-09-13):
> > 
> > 1) Currently the comments for newly created configuration file are not
> > updated, so for not this is 'undocumented feature'. Should there be an
> > empty configuration line as a placeholder ... ?
> > 
> > 2) Whenever some already existing directory is added to the exclude list
> > and the parent directory timestamp has not changed, notmuch new will not
> > notice the directory has gone (as it still is there), user needs to 'touch'
> > the parent directory before next 'notmuch new' no make notmuch notice.
> > 
> > 2012-01-26: could notmuch track mtime of the configuration file and if
> > that changes, ignore mail directory timestamps ?
> > 
> > 3) count_files() function is not touched. The functionality there has fallen
> > behind of add_files_recursive (maildir+tmp check and following symlinks).
> > The question there should it be updated, or attempted to merge with
> > add_files (as the comment says). count_files() is only called at the beginning
> > when database is not yet initialised.
> > ---

[ ... ]

> > +	/* Ignore user-specified directories */
> > +	for (j = 0; j < state->database_exclude_length; j++)
> > +	    if (strcmp(entry->d_name, state->database_exclude[j]) == 0)
> > +		break;
> > +	if (j < state->database_exclude_length)
> > +	    continue;
> 
> How about wrapping that in a function you can use here and below?
> 
> 	if (user_wants_this_excluded (...))
> 		continue;

Good point....

> Please also have a look at id:"87pqecylon.fsf at nikula.org" and the
> patches Austin posted. "Auto ignore"?

I personally don't mind auto ignore -- I even like the system yells about
those 3 files I forgot to add to ignore list every now and then (when the
mtime of the directory those are located changes). This is also something
different -- I can start keeping my drafts and spam directories alongside
other mail directories (or folders is you want to use that term).

Thanks for that id: it refers thread starting from id:"ylp7hi23mw8.fsf at tyndall.ie" 
( http://notmuchmail.org/pipermail/notmuch/2010/003145.html )

and the patch there is somewhat more complete (although old rebase-wise). 
It's easy to combine works together, but more difficult is to choose best 
terminology: database.exclude vs. new.ignore (or something in between or 
totally different). Ideas anyone?

Tomi


More information about the notmuch mailing list