From: Tomi Ollila Date: Fri, 27 Jan 2012 10:41:18 +0000 (+0200) Subject: Re: [PATCH 2/2] added support for user-specified directories to exclude X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=6cbb4f6d96751c4d298fe5d8b52d68ee980ed0e7;p=notmuch-archives.git Re: [PATCH 2/2] added support for user-specified directories to exclude --- diff --git a/bb/c2721189c489d34f80afbb9b68d79e05be7f0c b/bb/c2721189c489d34f80afbb9b68d79e05be7f0c new file mode 100644 index 000000000..88667bed3 --- /dev/null +++ b/bb/c2721189c489d34f80afbb9b68d79e05be7f0c @@ -0,0 +1,115 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 88306431FB6 + for ; Fri, 27 Jan 2012 02:41:21 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id z47GHsQ30q0T for ; + Fri, 27 Jan 2012 02:41:20 -0800 (PST) +Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66]) + by olra.theworths.org (Postfix) with ESMTP id 50FCB431FAE + for ; Fri, 27 Jan 2012 02:41:20 -0800 (PST) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 8917568056; Fri, 27 Jan 2012 12:41:18 +0200 (EET) +From: Tomi Ollila +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH 2/2] added support for user-specified directories to + exclude +In-Reply-To: <87pqe6ip6f.fsf@nikula.org> +References: <8762g0sj6f.fsf@praet.org> + <1327572718-13411-1-git-send-email-tomi.ollila@iki.fi> + <1327572718-13411-2-git-send-email-tomi.ollila@iki.fi> + <87pqe6ip6f.fsf@nikula.org> +User-Agent: Notmuch/0.11+116~g34d80c9 (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 27 Jan 2012 10:41:21 -0000 + +On Thu, 26 Jan 2012 13:11:36 +0000, Jani Nikula wrote: +> On Thu, 26 Jan 2012 12:11:58 +0200, Tomi Ollila 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@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@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