Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3C7F3431FD0 for ; Mon, 4 Jul 2011 11:48:19 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 aEG3V+3-BWz3 for ; Mon, 4 Jul 2011 11:48:18 -0700 (PDT) Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 37149431FB6 for ; Mon, 4 Jul 2011 11:48:18 -0700 (PDT) Received: by wwi14 with SMTP id 14so1680613wwi.2 for ; Mon, 04 Jul 2011 11:48:16 -0700 (PDT) Received: by 10.227.20.84 with SMTP id e20mr5486617wbb.28.1309805296543; Mon, 04 Jul 2011 11:48:16 -0700 (PDT) Received: from localhost ([109.131.160.67]) by mx.google.com with ESMTPS id fi5sm4693598wbb.56.2011.07.04.11.48.14 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jul 2011 11:48:15 -0700 (PDT) From: Pieter Praet To: Austin Clements Subject: Re: [PROTO] possible solution for "Race condition for '*' command" In-Reply-To: References: <20110703171743.GL15901@mit.edu> <1309762318-4530-1-git-send-email-pieter@praet.org> User-Agent: Notmuch/0.5-329-g1bb6068 (http://notmuchmail.org) Emacs/23.1.50.1 (x86_64-pc-linux-gnu) Date: Mon, 04 Jul 2011 20:48:12 +0200 Message-ID: <87sjqldgr7.fsf@praet.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 18:48:19 -0000 On Mon, 04 Jul 2011 13:56:26 -0400, Austin Clements wrote: Non-text part: multipart/alternative > 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). Duly noted. > (This also means * is not, in fact, equivalent to expanding the region > the the entire buffer and then tagging the region.) In fact it *is* but we'd be fetching the `matched-msgids' property rather than the `thread-id' property, for each line in 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. The matched MsgIds will be sufficient, as we'll want to operate on either the matched messages or the entire thread (for which the `thread-id' property is already present). Can't think of a use case for non-matched messages right now, but if required, we'll just use `set-exclusive-or'. > -- > Sent from my Android. Please excuse my brevity. Tip: K-9 Mail [1], apart from being much better than the stock email client, supports bottom-posting :) > 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 > Non-text part: text/html Peace -- Pieter [1] http://code.google.com/p/k9mail/