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 7933A429E38 for ; Tue, 26 Apr 2011 14:31:13 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.01 X-Spam-Level: X-Spam-Status: No, score=0.01 tagged_above=-999 required=5 tests=[T_MIME_NO_TEXT=0.01] 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 3tJQnwoEPE4O for ; Tue, 26 Apr 2011 14:31:12 -0700 (PDT) Received: from tesla.chaoflow.net (tesla.chaoflow.net [188.40.54.22]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A581F431FD0 for ; Tue, 26 Apr 2011 14:31:12 -0700 (PDT) Received: from eve.chaoflow.net (pD9F60B67.dip.t-dialin.net [217.246.11.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: flo@chaoflow.net) by tesla.chaoflow.net (Postfix) with ESMTPSA id E851AC768; Tue, 26 Apr 2011 23:31:09 +0200 (CEST) Received: by eve.chaoflow.net (Postfix, from userid 1000) id 96E18922; Tue, 26 Apr 2011 21:31:09 +0000 (Local time zone must be set--see zic manual page) From: Florian Friesdorf To: Pieter Praet , notmuch@notmuchmail.org Subject: Re: Optimization for notmuch tag by implicit filters In-Reply-To: <87mxjqgxmx.fsf@A7GMS.i-did-not-set--mail-host-address--so-tickle-me> References: <87y63d6y25.fsf@eve.chaoflow.net> <87mxjqgxmx.fsf@A7GMS.i-did-not-set--mail-host-address--so-tickle-me> User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) Date: Tue, 26 Apr 2011 23:31:09 +0200 Message-ID: <87k4egu2ci.fsf@eve.chaoflow.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Virus-Scanned: clamav-milter 0.96.5 at tesla X-Virus-Status: Clean 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: Tue, 26 Apr 2011 21:31:13 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Sat, 16 Apr 2011 14:59:34 +0200, Pieter Praet wrote: > On Thu, 14 Apr 2011 10:23:46 +0200, Florian Friesdorf = wrote: > >=20 > > With 60k messages and 12k tagged as sent: > >=20 > > $ time notmuch tag +sent -- from:flo@chaoflow.net > >=20 > > real 0m8.561s > > user 0m8.069s > > sys 0m0.212s > >=20 > > $ time notmuch tag +sent -- from:flo@chaoflow.net and not tag:sent > >=20 > > real 0m0.043s > > user 0m0.036s > > sys 0m0.006s > >=20 > >=20 > > This could be made implicit: > >=20 > > notmuch tag +A +B -- > > --> > > notmuch tag +A +B -- and not \(tag:A and tag:B\) > >=20 > > Apply command, if one of the tags is not set. > >=20 > >=20 > > notmuch tag -C -D -- > > --> > > notmuch tag -C -D -- and \(tag:C or tag:D\) > >=20 > > Apply command, if one of the tags is set. > >=20 > >=20 > > notmuch tag +A +B -C -D -- > > --> > > notmuch tag +A +B -C -D -- and \(not tag:A or not tag:B\ or ta= g:C or tag:D\) The second '\' after 'B' is not supposed to be there. > > In order to enforce tagging and disable the filter there could be a > > flag. > >=20 > > I lack the knowledge/time to implement it, but I think it's at least > > worth documenting it. >=20 > Most of us already do this explicitly in our tagging scripts, so no harm > in making it standard behaviour, I guess. >=20 > Though to keep the implementation nice & clean, I'd advise against the > use of parens: no need for escape chars, no messing with De Morgan's > law, simply map the tag operations to their inverse in conjunctively > joined filters: >=20 > notmuch tag +A +B -- and not tag:A or not tag:B > notmuch tag -C -D -- and tag:C or tag:D > notmuch tag +A +B -C -D -- and not tag:A or not tag:B or tag:C o= r tag:D I am not sure whether I understand what you mean. The parens are already supported by notmuch and also needed. Your second line for example would remove C and D, if D is set, independently of . Without parens, based on `and` taking precedence over `or`: F and (C or D) =3D F and C or F and D. =2D-=20 Florian Friesdorf GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083 Jabber/XMPP: flo@chaoflow.net IRC: chaoflow on freenode,ircnet,blafasel,OFTC --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAEBAgAGBQJNtzmdAAoJEDj4maMMRfCDUOEP/3re24TR1HOg/WtYWzaT4a0U SeV0FbkzXSmAumQ7bxoLi1XGLOhRYyrqArDycnaFEnuQA3FA1ymTZDzTXgneEXb3 2fdY7hYIp09E2LOAWjw5XiySW3/0Ar5N0lLbX41MUDXZym6zB5CH0O6ne714XjFB FSzS4OteTNawf4Wz68kNR59NyBHHoRBm5hlG6e/zgsQF3H3Jzs4K1mCSDMcQOD0Y Zv8Okal85Z1xW+zrVF6TnSMJ9BRo17zPFpwHc7YpQxWe/XG+i0FwrVQKrG/H+rNI z+cH5AHJw3W9PuOeIvxtM0D4T7YDjxK4Lj/yvPdTrH5HEW3eamIetiP5F9AcGzKv +G4UwpeRD4KuAHVSrkdpamnRXghH8GTnMf04afplmU3NTusfxMuARIJEnlmxJWz1 MqNIAgw6kL0m4hSl/eF7uES3a9XcUW+sylI0oUeXoRksMrNep76Gr3JJmMKrcHxY xTav3oRZ6aJVAAjo70E7glpgonQIPdx2+2b44TWGr6a/xVJ+/JnO8GaD9hoaHZmS nlRwwzH2Au/et1jnI0onOyE20yI4RuXV1aIp0RCU+Cqxc0AHZgm5+z62dRfjU2Zo fM9bZo2x5Pk/MBYKu2r9Xi6mHwhQdMk5pU527EA29+bRTY5whvH5JqHhXRfJK5BN XqU12HZSIvE1v7w98Fwn =BOKC -----END PGP SIGNATURE----- --=-=-=--