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 CB58E429E42 for ; Wed, 4 Jan 2012 06:13:14 -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 SkfP31OC+wkY for ; Wed, 4 Jan 2012 06:13:14 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 16986429E3D for ; Wed, 4 Jan 2012 06:13:13 -0800 (PST) Received: by werm12 with SMTP id m12so10893899wer.26 for ; Wed, 04 Jan 2012 06:13:12 -0800 (PST) Received: by 10.216.131.155 with SMTP id m27mr31547993wei.19.1325686392740; Wed, 04 Jan 2012 06:13:12 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id k33sm17587462wbo.5.2012.01.04.06.13.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Jan 2012 06:13:11 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 7288BA0334; Wed, 4 Jan 2012 14:13:09 +0000 (GMT) To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: call "notmuch tag" only once when archiving a thread In-Reply-To: <1325615346-8302-1-git-send-email-jani@nikula.org> References: <1325615346-8302-1-git-send-email-jani@nikula.org> User-Agent: Notmuch/0.10.2+151~gbf1dc2b (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-pc-linux-gnu) From: David Edmondson Date: Wed, 04 Jan 2012 14:13:05 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: Wed, 04 Jan 2012 14:13:15 -0000 --=-=-= Content-Type: text/plain This seems like a good idea. On Tue, 3 Jan 2012 20:29:06 +0200, Jani Nikula wrote: > On the downside, IIRC Xapian does not perform very well if the query > (in this case a lot of message-ids OR'd together) is very big. It is > unknown to me at which point this approach would become slower than > the original one by one tagging approach, if ever. Unless this limit is quite small (<1000), I'd be inclined not to worry about it. > Also, this introduces a limitation to the number of messages that can > be archived at the same time (through ARG_MAX limiting the command > line). At least on Linux this seems more like a theoretical limitation > than a real one. What's the failure mode when this does happen? > + (let ((message-ids)) No need for both sets of brackets: (let (message-ids) is sufficient. > + (loop do > + (let* ((current-tags (notmuch-show-get-tags)) > + (new-tags (notmuch-show-del-tags-worker current-tags toremove))) > + (unless (equal current-tags new-tags) > + (add-to-list 'message-ids (notmuch-show-get-message-id)))) > + until (not (notmuch-show-goto-message-next))) `loop' has the ability to accumulate results, which would probably be cleaner than `add-to-list'. See 'Accumulation Clauses' in the emacs cl info. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8EXnEACgkQaezQq/BJZRaFTwCfX+jZsleiDn+s29Lq+j7W5XI1 QT0Ani1F9ARA+nTMUMU7EdxijlfVfw4Y =Jyl2 -----END PGP SIGNATURE----- --=-=-=--