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 EE09C431FAE for ; Mon, 23 Nov 2009 10:26:53 -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 W4mxHZfasADF for ; Mon, 23 Nov 2009 10:26:52 -0800 (PST) Received: from keithp.com (home.keithp.com [63.227.221.253]) by olra.theworths.org (Postfix) with ESMTP id 42935431FBC for ; Mon, 23 Nov 2009 10:26:52 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 8967C7600E3; Mon, 23 Nov 2009 10:26:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from keithp.com ([127.0.0.1]) by localhost (keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Uxyq+LQL6hZq; Mon, 23 Nov 2009 10:26:48 -0800 (PST) Received: by keithp.com (Postfix, from userid 1033) id AB0F7B84011; Mon, 23 Nov 2009 10:26:48 -0800 (PST) Received: from keithp.com (localhost [127.0.0.1]) by keithp.com (Postfix) with ESMTP id 9E58C7600E3; Mon, 23 Nov 2009 10:26:48 -0800 (PST) From: Keith Packard To: Jed Brown , notmuch@notmuchmail.org, cworth@cworth.org In-Reply-To: <1258999643-30742-1-git-send-email-jed@59A2.org> References: <1258976966-22407-1-git-send-email-jed@59A2.org> <1258999643-30742-1-git-send-email-jed@59A2.org> Date: Mon, 23 Nov 2009 10:26:47 -0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: [notmuch] [PATCH] Make search filters handle disjunctive queries. 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: Mon, 23 Nov 2009 18:26:54 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Mon, 23 Nov 2009 19:07:23 +0100, Jed Brown wrote: > notmuch-search-filter accepts now accepts an arbitrary query and will > group if necessary so that we get >=20 > tag:inbox AND (gravy OR biscuits) >=20 > notmuch-search-filter-tag now handles multiple terms. All terms in the > query except AND and OR are interpreted as tags. Remember to split patches which do more than one thing into separate commits. > + (let ((grouped-query (if (string-match-p notmuch-search-disjunctive-re= gexp query) (concat "( " query " )") query))) > + (notmuch-search (concat notmuch-search-query-string " and " grouped-= query) notmuch-search-oldest-first))) Is there some reason not to just always add the parens? > + (let ((tagged-query (replace-regexp-in-string notmuch-search-valid-ter= m-regexp > + (lambda (match) ; Prepend `tag:' to all except boolean operators > + (if (string-match-p notmuch-search-boolean-operator-regexp match) > + match (concat "tag:" match))) > + query))) This seems useful; how does it deal with the tag completion stuff? =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFLCtPoQp8BWwlsTdMRAl1BAJ9mOfP6NR4FpfkWfrfbjU/4EArVpwCfUazA dnK9vAUjOe/iVYyTwOOtEh4= =hGvK -----END PGP SIGNATURE----- --=-=-=--