[notmuch] Bulk message tagging

Mark Anderson MarkR.Anderson at amd.com
Fri Apr 23 13:05:59 PDT 2010


On Wed, 21 Apr 2010 18:02:59 -0500, Carl Worth <cworth at cworth.org> wrote:
> On Sat, 17 Apr 2010 20:32:27 +0200, Arian Kuschki <arian.kuschki at googlemail.com> wrote:
> > So one could query with sysconf and break things up into multiple
> > commands as needed.
> > 
> > Doesn't xargs do exactly this?
> 
> Almost.
> 
> The arguments being passed to the "notmuch tag" command in this case
> look like:
> 
> 	notmuch tag -inbox thread:foo or thread:bar or ...
> 
> To break that up, we'd have to be careful to neither leave a trailing
> 'or' at the end of a command line nor to have an 'or' at the beginning
> of a command line.

Perhaps this hints at an opportunity to create a new operator, that you
can pass as part of the notmuch commandline.

Something like:
cat idlist.txt | xargs notmuch tag -inbox tag:inbox and oneof: 

Then the list of arguments can break anywhere it wants. It's not as
general as having notmuch take search terms from stdin or a file, but it
seems like a long list of ID's is going to be a common case.

Another problem with passing options to xarg is that any parentheses are
going to break easily.

Actually, looking at this random proposal, you can see the invented
operator has an implicit grouping semantic, which leads to all kinds of
confusion.

-Mark



More information about the notmuch mailing list