On Fri, 18 Dec 2009 00:49:00 -0700, Mark Anderson wrote: > I was updating my poll script that tags messages, and a common idiom is > to put > tag +mytag and not tag:mytag > > I don't know anything about efficiency, but for the simple single-tag > case, couldn't we imply the "and not tag:mytag" from the +mytag action > list for the tag command? On one level, it really shouldn't be a performance issue to tag messages that already have a particular tag. (And in fact, the recently proposed patches to fix Xapian defect 250 even address this I think.) In the meantime, it is fairly annoying to have to type this, and yes, the tag command could infer that and append it to the search string automatically. That's a good idea, really. > The similar (dual?, rusty math terminology, beware of Math-tetanus) case > of "tag -mytag and tag:mytag" could be similarly optimized, > since the tag removal action ought to be a null action in the case that > the search terms matched on a thread or message, but the tag to be > removed isn't attached to the message/thread returned. Yes, that would work too. One potential snag with both ideas is that the "notmuch tag" command-line as currently implemented allows for multiple tag additions and removals with a single search. So the optimization here couldn't be used unless there was just a single tag action. So that's another reason to really just want the lower-level optimization to be in place. -Carl