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 EA15A431FBF for ; Mon, 23 Nov 2009 10:48:17 -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 TP+FWhdaVijh for ; Mon, 23 Nov 2009 10:48:17 -0800 (PST) Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by olra.theworths.org (Postfix) with ESMTP id 05F8A431FAE for ; Mon, 23 Nov 2009 10:48:16 -0800 (PST) Received: by bwz2 with SMTP id 2so5565604bwz.0 for ; Mon, 23 Nov 2009 10:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:subject :in-reply-to:references:date:message-id:mime-version:content-type; bh=31alTVKVoyOMxzJ8Zx8riuc6ikDq8vY3Jq3hSUtGDuw=; b=RuKtuxPotcCVengoYu6zBDmaE/AeBIOB3e4puCaPWxZO0869atOE1uFtutN96EjgAw 2B/rUpKcLV0yMUYYf9n3kijcwBudYlIGbpMDgBqHHl19Kftq7oqU5jecfgjWmL5CmBSz MCka2+xLEDvOiU0j6Y3N6/Z1Q3mMoN8RzwDjs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; b=pXpcYRy+tY+6s7Iv3z7wa6itLsmlx4X6hlNuXwUaIl7ielJ3MQu3szIu3Cfahbv9EO Zj78oRDRfzFcRR2jNkyrONxw/EZra8hbfx5NR7W07tqoK/OOPkHHMMqczn7rOqXJ/BPv 4AxkTxc237C8XdOHN/IMlOgvgzO131BDH6D9E= Received: by 10.204.34.201 with SMTP id m9mr5173982bkd.77.1259002096006; Mon, 23 Nov 2009 10:48:16 -0800 (PST) Received: from kunyang (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id 9sm6078948fks.22.2009.11.23.10.48.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Nov 2009 10:48:14 -0800 (PST) Sender: Jed Brown From: Jed Brown To: Keith Packard , notmuch@notmuchmail.org, cworth@cworth.org In-Reply-To: References: <1258976966-22407-1-git-send-email-jed@59A2.org> <1258999643-30742-1-git-send-email-jed@59A2.org> Date: Mon, 23 Nov 2009 19:48:46 +0100 Message-ID: <87d439jcvl.fsf@59A2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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:48:18 -0000 On Mon, 23 Nov 2009 10:26:47 -0800, Keith Packard wrote: > Remember to split patches which do more than one thing into separate > commits. These are variants of the same operation, but I'll split in the future. > > + (let ((grouped-query (if (string-match-p notmuch-search-disjunctive-regexp 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? That's what I did initially, but it's messy to look at in the mode line after applying successive filters. > This seems useful; how does it deal with the tag completion stuff? It doesn't do anything special, but I haven't been following that carefully. My thought was that eventually the regular interactive search and filters, would have semantic completion, e.g. the user enters tag:ab and tags would be completed, but they could also do from:long.unwieldy.addr In filter-by-tag, the natural thing would be to only complete tags, the user would be on their own to spell out AND, OR, and NOT. Unfortunately I'm not familiar enough with elisp to implement this quickly. A closely related issue is managing the address book. I guess the usual advice is to use BBDB. I don't know if it's better to hook into that or for Notmuch to have it's own lightweight approach. I could imagine harvesting addresses of everyone I've sent mail to and giving me a semi-automated way to merge addresses that are likely to point to the same person. Jed