post-new [was: Re: query on a subset of messages ?]

Jani Nikula jani at nikula.org
Tue Jul 10 06:16:14 PDT 2012


On Jul 10, 2012 12:59 PM, "Sebastien Binet" <binet at cern.ch> wrote:
>
> Jani Nikula <jani at nikula.org> writes:
>
> > On Jul 9, 2012 8:12 PM, "Jameson Graef Rollins" <
jrollins at finestructure.net>
> > wrote:
> >>
> >> On Mon, Jul 09 2012, Sebastien Binet <binet at cern.ch> wrote:
> >> > hum... is post-new supposed to be run even if there is no new
message ?
> >>
> >> Hi, Sebastian.  Yes, I think it runs regardless if there are any new
> >> messages or not.
> >
> > That's correct; only errors in notmuch new cause post-new hook to be
> > skipped.
>
> ok. I thought using the post-new hook would have saved some i/o
> resources over my current setup:
>  offlineimap.postsynchook = ~/emacs/notmuch-lib/notmuch-tag.sh
>
> where notmuch-tag.sh is (in pseudo-code):
> ##
> /usr/bin/notmuch new
>
> for tag,query in tag-queries:
>   tag_new $tag $query
>
> ##
>
> is there any advantage of using post-new compared to this setup ?

There's no functional advantage. It does keep your initial tagging script
connected with notmuch new rather than offlinemap, if you ever need to run
notmuch new on its own.

If your tagging setup is really complicated, you could have some-tag in
new.tags config, and bail out early if notmuch count tag:some-tag outputs 0
(and obviously notmuch tag -some-tag tag:some-tag later in the script).
Just a thought.

J.

>
> -s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120710/c069b7cf/attachment.html>


More information about the notmuch mailing list