[PATCH] notmuch new --new-tags=tags...

Jameson Rollins jrollins at finestructure.net
Mon Apr 12 04:59:14 PDT 2010


On Mon, 12 Apr 2010 10:00:37 +0200, "Sebastian Spaeth" <Sebastian at SSpaeth.de> wrote:
> On 2010-04-10, Anthony Towns wrote:
> > The attached patch makes "notmuch new --new-tags=unread,new" set the
> > "unread" and "new" tags on any new mail it finds rather than "unread"
> > and "inbox". Or whatever other tags you happen to specify.
> 
> Thanks for the patch. I can't comment on the code quality, but rather
> than having to specify the set of new tags on the command line every
> time, I think it would make more sense to put them in the notmuch config
> file as this patch does:
> id:1268432006-24333-2-git-send-email-bgamari.foss at gmail.com

I was thinking about this, and it seems to me that we really need is a
way to just specify which tags should be applied to new messages based
on search terms.  It's becoming pretty clear that most people are doing
some sort of post-notmuch-new tag processing to modify the tags of new
messages to suite their needs.  Why not just integrate this directly
into the notmuch-new processing itself?  It seems like if this was
integrated into notmuch-new directly, the entire processing of new
messages could be sped up considerably, so that one wouldn't have to
call multiple notmuch-new processes in succession.

I'm not sure exactly what the best way to handle it would be, but I can
imagine something like this:

[new-tags]
+sent -new -- from:jrollins at finestructure.net
+drafts -new -- folder:draft
+notmuch -- from:notmuch at notmuchmail.org
+unread +inbox -new -- tag:new

These are all just commands for "notmuch tag" that would be run on all
the new messages as they're processed.  Each new message would be given
"new" tag by default, and then the new tag commands would be run.  So it
would be the equivalent of running the following commands:

notmuch new --new-tags=new
notmuch tag +sent -new -- from:jrollins at finestructure.net
notmuch tag +drafts -new -- folder:draft
notmuch tag +notmuch -- from:notmuch at notmuchmail.org
notmuch tag +unread +inbox -- tag:new

This would make things much easier for everyone who is doing post-new
tag processing, which I think is probably most people.  And I'm sure it
could be made much more efficient (if coded properly) than running all
these notmuch commands in succession, especially for people who have a
lot of post-new tag processing to do.  Keeping the syntax identical to
the notmuch-tag command syntax would keep things simple as well.

Do people who do a lot of post-notmuch-new tag processing think
something like this would suite their needs?

jamie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100412/682fa27e/attachment.pgp>


More information about the notmuch mailing list