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 CF6D2431FD0 for ; Sun, 8 Jan 2012 18:34:39 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 pnfZrRjZoABq for ; Sun, 8 Jan 2012 18:34:39 -0800 (PST) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id 1008B431FB6 for ; Sun, 8 Jan 2012 18:34:39 -0800 (PST) Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) by fire-doxen-postvirus (Postfix) with ESMTP id 72A422E50E6E; Sun, 8 Jan 2012 18:34:38 -0800 (PST) X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new Received: from finestructure.net (cpe-76-174-137-84.socal.res.rr.com [76.174.137.84]) (Authenticated sender: jrollins) by fire-doxen-submit (Postfix) with ESMTP id 722D02E50D07; Sun, 8 Jan 2012 18:34:34 -0800 (PST) Received: by finestructure.net (Postfix, from userid 1000) id 1FD53A4A; Sun, 8 Jan 2012 18:34:34 -0800 (PST) From: Jameson Graef Rollins To: Austin Clements , Aaron Ecay Subject: Re: [PATCH 1/4] emacs: new customization variable to exclude "deleted" messages from search In-Reply-To: <20120109014938.GE20796@mit.edu> References: <1325975294-646-1-git-send-email-jrollins@finestructure.net> <1325975294-646-2-git-send-email-jrollins@finestructure.net> <20120109014938.GE20796@mit.edu> User-Agent: Notmuch/0.10.2+168~g34b8bac (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sun, 08 Jan 2012 18:34:31 -0800 Message-ID: <87ehv9r4co.fsf@servo.finestructure.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Cc: Notmuch Mail 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 02:34:40 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sun, 8 Jan 2012 20:49:38 -0500, Austin Clements wrote: > > > @@ -927,6 +932,9 @@ The optional parameters are used as follows: > > > (set 'notmuch-search-target-thread target-thread) > > > (set 'notmuch-search-target-line target-line) > > > (set 'notmuch-search-continuation continuation) > > > + (when (and notmuch-search-exclude-deleted > > > + (not (string-match "tag:deleted[ )]*" query))) > >=20 > > =E2=80=9Cis:=E2=80=9D is a synonym for =E2=80=9Ctag:=E2=80=9D in search= es =E2=80=93 so this section of the code > > should look for it too. >=20 > There are several other things that could also trip up this regexp. > xtag:deletedx would be falsely matched, as would a quoted phrase > containing "tag:deleted", while tag:"deleted" and tag:(deleted) would > incorrectly not be matched. Thanks so much for the review, guys. I should have mentioned in this patch that the my regex skills are very weak, and that it was surely incomplete. I always forget about the is: prefix as well. > Getting this right is hard, though I'd be happy with >=20 > "\\<\\(tag\\|is\\):deleted\\>" Every time I think I start to understand regex I am reminded that it's black magic and I really know nothing. For instance, I am not familiar with "<" or ">", although they appear to be a "word" boundaries (although I'm not sure how "word" is defined). Also, why is all the \\ (double?) escaping needed? I'll certainly take your word for it, though. > or maybe >=20 > "\\<\\(tag\\|is\\):\\(\"?\\)deleted\\>\\2" After staring at this for 10 minutes I think I'm getting the extra bits here. It matches an initial \", and then a second at the end if the first matched. That's clever. Why=20 \\>\\2 instead of \\2\\> ? I'm definitely confused by why so much apparent escaping is needed, though. > Implicit exclusions like this were actually one of my target features > for the custom query parser, but I think hacking around that by > inspecting the query string is a fine interim solution. (One of these > months I'll dust off the query parser, really!) Very much looking forward to it! jamie. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJPClI3AAoJEO00zqvie6q8UO0QAJpYXKY39AcSu5PbxRCfKOwg itvu4fBRu5zgh13Tc6uOkIWf8jlWhDpPvAkAmZkZDTj1llZIAyTgA4UFbJT/mgBB gNgsdou61Z0/T6zjmHUXd6AoKy+u+MJbtoGAGhM/diIAKgZTGc32YtbQwyidY702 YfHQISWmOcMwu50395BvDt7d8E41B0+WAUXoa3GH+pXNGFnJSp2lGndouWJXrlkQ Xc3CNQe0mRwbbXgTipii9YQ/dQvGxHy3qu0LLKUgTcnYYdUdvAFswdoZU3/6wB/+ wH4iSVYqleJYgYHuq2f+j6cIWPhcljlE5oBY/a1tanLMp2GG9eUHObRfnjj1IHvr KYauLzHOfb6L6tVaQso2KSxPc36yl5O6fcWPmoO4E1Rt/jaiUesy8zaybkhheQrp BhUjMU/R65AI/toG1x0KTN4iHK1mEc/fOFOSSNZ/f9SRv1ZOjYYzMZrWZq01IAC+ +bt+BSsywkygs32JCw6rvMvxxhW2asTBRtwi793PktlfAAm11s79WzhU6C71fYtP KA5FC1q9pGQRLcLFU9+S6xLoKEkvJYYz9GpSWWOjt59Q5e92CLa4FR2XjqSZe9aT 8e53/ByYpBCnIWsj0srZqwzgFLvmbO4UYYYO+9kgAxKF2N5TwcdleXMZlMfGP3Gu a81xxSqAYIPuY4+RjV1m =6igb -----END PGP SIGNATURE----- --=-=-=--