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 C575D431FD0 for ; Mon, 9 Jan 2012 00:41:23 -0800 (PST) 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 6jkvamzNU1KB for ; Mon, 9 Jan 2012 00:41:23 -0800 (PST) Received: from mail-tul01m020-f181.google.com (mail-tul01m020-f181.google.com [209.85.214.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 254C7431FB6 for ; Mon, 9 Jan 2012 00:41:23 -0800 (PST) Received: by obbup6 with SMTP id up6so4198760obb.26 for ; Mon, 09 Jan 2012 00:41:21 -0800 (PST) Received: by 10.182.52.66 with SMTP id r2mr13643184obo.56.1326098481568; Mon, 09 Jan 2012 00:41:21 -0800 (PST) Received: from localhost (nikula.org. [92.243.24.172]) by mx.google.com with ESMTPS id h1sm73909077obj.3.2012.01.09.00.41.18 (version=SSLv3 cipher=OTHER); Mon, 09 Jan 2012 00:41:20 -0800 (PST) From: Jani Nikula To: Austin Clements , Aaron Ecay Subject: Re: [PATCH] emacs: call "notmuch tag" only once when archiving a thread In-Reply-To: <20120109011259.GD20796@mit.edu> References: <1325615346-8302-1-git-send-email-jani@nikula.org> <87fwftao1b.fsf@nikula.org> <20120109011259.GD20796@mit.edu> User-Agent: Notmuch/0.10.2+129~g8a76c81 (http://notmuchmail.org) Emacs/23.1.1 (i686-pc-linux-gnu) Date: Mon, 09 Jan 2012 08:41:15 +0000 Message-ID: <87k451clp0.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: notmuch@notmuchmail.org 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, 09 Jan 2012 08:41:23 -0000 On Sun, 8 Jan 2012 20:12:59 -0500, Austin Clements wrote: > Quoth Aaron Ecay on Jan 08 at 7:56 pm: > > On Thu, 05 Jan 2012 22:32:16 +0200, Jani Nikula wrote: > >=20 > > [...] > >=20 > > > In the show view it only modifies the messages that are currently > > > visible. This is to make sure you don't accidentally archive things t= hat > > > have arrived after refreshing the buffer. I think this is safest. > >=20 > > Hmm. Perhaps it would make sense to add a check in the search view that > > the thread being archived[1] has the same number of messages as it did > > when the buffer was constructed. (The information on how many messages > > the thread has is in the buffer; we would then compare this to the resu= lt > > of =E2=80=9Cnotmuch count thread:000foo=E2=80=9D when the user requests= to archive.) If > > the counts don=E2=80=99t match, the interface should show a message in = the echo > > area and (probably) refuse to do the tagging. >=20 > That sounds like a clever workaround. The downside is that there's still a race condition: you could get new messages between checking the number of messages in the thread and tagging. The window for error would be much smaller than now, but it's still there. (You could check afterwards if this happened, and notify the user, "oooops, I just tagged N messages more than you intended"...) J.