From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 22938431FD0 for ; Mon, 4 Jul 2011 10:56:28 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id odRhSwQ+q4A0 for ; Mon, 4 Jul 2011 10:56:27 -0700 (PDT) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id 1CF23431FB6 for ; Mon, 4 Jul 2011 10:56:27 -0700 (PDT) X-AuditID: 1209190d-b7bdeae0000004f8-92-4e11fe73abc4 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id C9.EE.01272.37EF11E4; Mon, 4 Jul 2011 13:54:59 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id p64HuQHH027502; Mon, 4 Jul 2011 13:56:26 -0400 Received: from [10.247.103.25] (162.sub-174-252-57.myvzw.com [174.252.57.162]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p64HuFPu021882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 4 Jul 2011 13:56:24 -0400 (EDT) References: <20110703171743.GL15901@mit.edu> <1309762318-4530-1-git-send-email-pieter@praet.org> User-Agent: K-9 Mail for Android In-Reply-To: <1309762318-4530-1-git-send-email-pieter@praet.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----TNBCPH3ADEBNTKTYUGJVLMN8JRAE0R" Subject: Re: [PROTO] possible solution for "Race condition for '*' command" From: Austin Clements Date: Mon, 04 Jul 2011 13:56:26 -0400 To: Pieter Praet Message-ID: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLKsWRmVeSWpSXmKPExsUixG6nolv8T9DP4OwtaYvrN2cyW/x+fYPZ gcnj2apbzB4d+y6zBjBFcdmkpOZklqUW6dslcGXs2fSGreCCWkX31u1MDYyXFboYOTkkBEwk Dr5czAphi0lcuLeerYuRi0NIYB+jxOnvT6Gc9YwSO3rOsUM4F5kkmvt6mUBahAQSJPZsfsQG YosKKEjMmzyREcTmFHCQ2D/lO5jNKyAocXLmExYQm1kgSGLl4fVg9cIC3hKfns4Fi7MJaEhs 278crJ5FQFXi1tmD7CC2iICyxOknP9kherUkni25DDXTRWLm1TksExgFZiFZMQvJCghbU+La 8S3sELa8RPPW2cwQtobE3GfPmJHFFzCyrWKUTcmt0s1NzMwpTk3WLU5OzMtLLdI10svNLNFL TSndxAgKeU5J3h2M7w4qHWIU4GBU4uGtvCPoJ8SaWFZcmXuIUZKDSUmUd/lfoBBfUn5KZUZi cUZ8UWlOavEhRgkOZiUR3ruLgHK8KYmVValF+TApaQ4WJXFeNe//vkIC6YklqdmpqQWpRTBZ GQ4OJQne9yBDBYtS01Mr0jJzShDSTBycIMN5gIbfAqnhLS5IzC3OTIfIn2LU5Ti36+lhRiGW vPy8VClxXnZgshESACnKKM2DmwNLVa8YxYHeEuZ9CzKKB5jm4Ca9AlrCBLTEKhFsSUkiQkqq gTFEgG/e77TS6X2lbdaPTzS8Zr1icU5zj0b7oXAHxUOOAT7fIvjs1Pp6dl80XXDviIgwx+J5 d15/mKLtE6mtkWT3Nejpmkzl7mrZaP1Zyds3Jsc0zwu889Wuek9wpvqKm63sV1ULPrhe1ms5 0PExpmDCDktvQ6+HNYWOMnrbF1zaru3HOmnVCSWW4oxEQy3mouJEAMgKKCgwAwAA Cc: Notmuch Mail X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 17:56:28 -0000 ------TNBCPH3ADEBNTKTYUGJVLMN8JRAE0R Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). (This also means * is not, in fact, equivalent to expanding the region the the entire buffer and then tagging the region.) 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. -- Sent from my Android. Please excuse my brevity. Pieter Praet wrote: Thanks Austin! Unfortunately, your patch causes *all* Message-Id's in the thread to be appended, as opposed to only the ones matching the query: #+BEGIN_EXAMPLE $ notmuch search tag:inbox AND from:amdragon@mit.edu thread:0000000000002777 Yest. 19:17 [1/3] Austin Clements| Pieter Praet; [PATCH 2/2] [RFC] possible solution for "Race condition for '*' command" (inbox replied sent to-me x/notmuch) id:"CAH-f9WticM4EN8F1_ik_-mcBcBtrXwSpO+Drbtp7=UN7McECrg@mail.gmail.com" or id:"87zkkwydag.fsf@praet.org" or id:"20110703171743.GL15901@mit.edu" #+END_EXAMPLE As you can see, according to matched/total ("[1/3]") only a single message matches the query, yet all 3 MsgId's are returned. If this were to be corrected (probably a trivial change, but I'm pretty much oblivious as to the what and where of it), the following patch series should work as intended. The "--stdin" option works as expected (and ARG_MAX is indeed a very valid concern with this particular use case), but I haven't yet gotten around to making use of it from the Emacs UI as this would require some screwing around with `notmuch-tag' and `notmuch-call-notmuch-process', and it's still pretty early I-). Peace -- Pieter ------TNBCPH3ADEBNTKTYUGJVLMN8JRAE0R Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit 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).

(This also means * is not, in fact, equivalent to expanding the region the the entire buffer and then tagging the region.)

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.
--
Sent from my Android. Please excuse my brevity.

Pieter Praet <pieter@praet.org> wrote:
Thanks Austin!

Unfortunately, your patch causes *all* Message-Id's in the thread to be
appended, as opposed to only the ones matching the query:

#+BEGIN_EXAMPLE
$ notmuch search tag:inbox AND from:amdragon@mit.edu
thread:0000000000002777 Yest. 19:17 [1/3] Austin Clements| Pieter Praet;
[PATCH 2/2] [RFC] possible solution for "Race condition for '*' command"
(inbox replied sent to-me x/notmuch)
id:"CAH-f9WticM4EN8F1_ik_-mcBcBtrXwSpO+Drbtp7=UN7McECrg@mail.gmail.com"
or id:"87zkkwydag.fsf@praet.org" or id:"20110703171743.GL15901@mit.edu"
#+END_EXAMPLE

As you can see, according to matched/total ("[1/3]") only a single
message matches the query, yet all 3 MsgId's are returned.

If this were to be corrected (probably a trivial change, but I'm pretty
much oblivious as to the what and where of it), the following patch
series should work as intended.

The "--stdin" option works as expected (and ARG_MAX is indeed a very
valid concern with this particular use case), but I haven't yet gotten
around to making use of it from the Emacs UI as this would require some
screwing around with `notmuch-tag' and `notmuch-call-notmuch-process',
and it's still pretty early I-).

Peace

--
Pieter

------TNBCPH3ADEBNTKTYUGJVLMN8JRAE0R--