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 6A090429E25 for ; Mon, 9 Jan 2012 02:39:08 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 nGfaHjGuJD2w for ; Mon, 9 Jan 2012 02:39:07 -0800 (PST) Received: from mail-gw3.nixu.fi (mail-gw3.nixu.fi [193.209.237.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9B69F429E21 for ; Mon, 9 Jan 2012 02:39:06 -0800 (PST) Received: from pps.filterd (mail-gw3 [127.0.0.1]) by mail-gw3.nixu.fi (8.14.4/8.14.4) with SMTP id q09Ad07u031401; Mon, 9 Jan 2012 12:39:00 +0200 Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by mail-gw3.nixu.fi with ESMTP id 114cs0yaa8-1 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 09 Jan 2012 12:38:59 +0200 Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q09Acx7q014251; Mon, 9 Jan 2012 12:38:59 +0200 From: Tomi Ollila To: Jani Nikula , Austin Clements , Aaron Ecay Subject: Re: [PATCH] emacs: call "notmuch tag" only once when archiving a thread In-Reply-To: <87k451clp0.fsf@nikula.org> References: <1325615346-8302-1-git-send-email-jani@nikula.org> <87fwftao1b.fsf@nikula.org> <20120109011259.GD20796@mit.edu> <87k451clp0.fsf@nikula.org> User-Agent: Notmuch/0.10.2+157~g442d405 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2012-01-09_03:2012-01-09, 2012-01-09, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1201090043 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 10:39:08 -0000 On Mon, 09 Jan 2012 08:41:15 +0000, Jani Nikula wrote: > On Sun, 8 Jan 2012 20:12:59 -0500, Austin Clements wro= te: > > Quoth Aaron Ecay on Jan 08 at 7:56 pm: > > > On Thu, 05 Jan 2012 22:32:16 +0200, Jani Nikula wro= te: > > >=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= that > > > > 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 t= hat > > > the thread being archived[1] has the same number of messages as it did > > > when the buffer was constructed. (The information on how many messag= es > > > the thread has is in the buffer; we would then compare this to the re= sult > > > of =E2=80=9Cnotmuch count thread:000foo=E2=80=9D when the user reques= ts to archive.) If > > > the counts don=E2=80=99t match, the interface should show a message i= n the echo > > > area and (probably) refuse to do the tagging. > >=20 > > That sounds like a clever workaround. >=20 > 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"...) And this could also be "false alarm" if the the new messages arrived after tagging but before checking... >=20 > J. Tomi