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 56D35431FBF; Fri, 18 Dec 2009 09:39:11 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 TIPMgAMxrsT8; Fri, 18 Dec 2009 09:39:10 -0800 (PST) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6DAF3431FAE; Fri, 18 Dec 2009 09:39:10 -0800 (PST) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 36B44254306; Fri, 18 Dec 2009 09:39:10 -0800 (PST) From: Carl Worth To: Mark Anderson , notmuch@notmuchmail.org In-Reply-To: <3wdskb8oh77.fsf@testarossa.amd.com> References: <3wdskb8oh77.fsf@testarossa.amd.com> Date: Fri, 18 Dec 2009 09:39:09 -0800 Message-ID: <87hbroyyf6.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: [notmuch] Rather simple optimization for notmuch tag X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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: Fri, 18 Dec 2009 17:39:11 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Fri, 18 Dec 2009 00:49:00 -0700, Mark Anderson = wrote: > I was updating my poll script that tags messages, and a common idiom is > to put > tag +mytag and not tag:mytag >=20 > I don't know anything about efficiency, but for the simple single-tag > case, couldn't we imply the "and not tag:mytag" from the +mytag action > list for the tag command? On one level, it really shouldn't be a performance issue to tag messages that already have a particular tag. (And in fact, the recently proposed patches to fix Xapian defect 250 even address this I think.) In the meantime, it is fairly annoying to have to type this, and yes, the tag command could infer that and append it to the search string automatically. That's a good idea, really. > The similar (dual?, rusty math terminology, beware of Math-tetanus) case > of "tag -mytag and tag:mytag" could be similarly optimized, > since the tag removal action ought to be a null action in the case that > the search terms matched on a thread or message, but the tag to be > removed isn't attached to the message/thread returned. Yes, that would work too. One potential snag with both ideas is that the "notmuch tag" command-line as currently implemented allows for multiple tag additions and removals with a single search. So the optimization here couldn't be used unless there was just a single tag action. So that's another reason to really just want the lower-level optimization to be in place. =2DCarl --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFLK74+6JDdNq8qSWgRAnO2AJ9yqhPa23LeXMRc5oYUEpbkP4JsrQCeOHPR 2AyrmAB07iysMn0XGTHcffw= =fKqk -----END PGP SIGNATURE----- --=-=-=--