<html><head></head><body>Ah, this is subtler than I thought. You're right that, for the '*' command, you want only the matched ID's. Tagging a region, however, operates on entire threads. I think it's important to retain this behavior because threads are what the user sees and selects in the search buffer (*, on the other hand, doesn't have a strong visual analogue).<br>
<br>
(This also means * is not, in fact, equivalent to expanding the region the the entire buffer and then tagging the region.)<br>
<br>
I should probably emit two lists per thread: one of matched IDs and one of unmatched IDs. Tagging a region can then operate on the concatenation of these, while * can operate only on the matched lists. This should be easy to do. I'll send an updated patch when I'm back at a computer.<br>
-- <br>
Sent from my Android. Please excuse my brevity.<br><br><div class="gmail_quote">Pieter Praet <pieter@praet.org> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif">Thanks Austin!<br /><br />Unfortunately, your patch causes *all* Message-Id's in the thread to be<br />appended, as opposed to only the ones matching the query:<br /><br />#+BEGIN_EXAMPLE<br />$ notmuch search tag:inbox AND from:amdragon@mit.edu<br />thread:0000000000002777 Yest. 19:17 [1/3] Austin Clements| Pieter Praet;<br />[PATCH 2/2] [RFC] possible solution for "Race condition for '*' command"<br />(inbox replied sent to-me x/notmuch)<br />id:"CAH-f9WticM4EN8F1_ik_-mcBcBtrXwSpO+Drbtp7=UN7McECrg@mail.gmail.com"<br />or id:"87zkkwydag.fsf@praet.org" or id:"20110703171743.GL15901@mit.edu"<br />#+END_EXAMPLE<br /><br />As you can see, according to matched/total ("[1/3]") only a single<br />message matches the query, yet all 3 MsgId's are returned.<br /><br />If this were to be corrected (probably a trivial change, but I'm pretty<br />much oblivious as to the what and where of it), the following
patch<br />series should work as intended.<br /><br />The "--stdin" option works as expected (and ARG_MAX is indeed a very<br />valid concern with this particular use case), but I haven't yet gotten<br />around to making use of it from the Emacs UI as this would require some<br />screwing around with `notmuch-tag' and `notmuch-call-notmuch-process',<br />and it's still pretty early I-).<br /><br />Peace<br /><br />-- <br />Pieter<br /><br /></pre></blockquote></div></body></html>