On Mon, Apr 09 2012, Mark Walters <markwalters1009@gmail.com> wrote: > My only comment here is that I wonder about the tag-all command. I can > see that this is a performance win over applying tag region to the whole > buffer but is it another place where we have a race with incoming mail > (ie we tag everything that now matches rather than everything in the > buffer). Yes, I think this is a problem. notmuch-{search,show}-tag-all are both subject to race conditions. I suggest we remove notmuch-search-tag-all in favor of the region tagging capabilities of notmuch-show-tag. I will submit a patch for that. notmuch-show-tag-all is trickier, since there no tag-by-region capability at the moment. That will have to be added before this function can be replaced. > A second advantage with the tag-region form is that it automatically > does excludes. Currently notmuch-tag does not do excludes as it looked > very hairy to implement correctly: thus the tag-all command could spend > a lot of time tagging excluded messages. Actually, I don't think this is true, at least for search mode. In search mode threads are tagged by their thread id, therefore any excluded messages in the thread will receive the same tagging operations. The current operation is at least, in my opinion, self consistent. If we're going to tag by thread then all messages in the thread should be tagged, whether or not they're excluded. I do think, however, that it might be nice to add a tagging function that only tags the matching messages in the thread. In that case excluded messages would not be tagged. That's for future work, though. jamie.