Re: [notmuch] [RFC] Precedence of OR and AND
authorBart Trojanowski <bart@jukie.net>
Sun, 22 Nov 2009 21:36:49 +0000 (16:36 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:39 +0000 (09:35 -0800)
47/ad8b16a89a4a56449d3264ac1de777f1f84312 [new file with mode: 0644]

diff --git a/47/ad8b16a89a4a56449d3264ac1de777f1f84312 b/47/ad8b16a89a4a56449d3264ac1de777f1f84312
new file mode 100644 (file)
index 0000000..6a562bb
--- /dev/null
@@ -0,0 +1,91 @@
+Return-Path: <bart@jukie.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 659D7431FBC\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 13:36:51 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id g49ljrjUjW+A for <notmuch@notmuchmail.org>;\r
+       Sun, 22 Nov 2009 13:36:50 -0800 (PST)\r
+Received: from tau.jukie.net (tau.jukie.net [216.239.93.128])\r
+       by olra.theworths.org (Postfix) with ESMTP id 56077431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 13:36:50 -0800 (PST)\r
+Received: by tau.jukie.net (Postfix, from userid 1000)\r
+       id ABB23C02F86; Sun, 22 Nov 2009 16:36:49 -0500 (EST)\r
+Date: Sun, 22 Nov 2009 16:36:49 -0500\r
+From: Bart Trojanowski <bart@jukie.net>\r
+To: Jed Brown <jed@59A2.org>\r
+Message-ID: <20091122213649.GJ17268@jukie.net>\r
+References: <87y6ly45fc.fsf@59A2.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <87y6ly45fc.fsf@59A2.org>\r
+User-Agent: Mutt/1.5.18 (2008-05-17)\r
+Cc: notmuch@notmuchmail.org\r
+Subject: Re: [notmuch] [RFC] Precedence of OR and AND\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 22 Nov 2009 21:36:51 -0000\r
+\r
+Wouldn't this problem be solved by each filter appending a bracketed\r
+version of your filter?\r
+\r
+You start with tag:inbox and you filter on "term1 or term2" you'd get:\r
+\r
+        tag:inbox and (term1 or term2)\r
+\r
+Doing it again would result in...\r
+\r
+        tag:inbox and (term1 or term2) and (term3 or term4)\r
+\r
+To me, it would seem the most intuitive solution.\r
+\r
+Actually, I think I'll add that to notmuch.vim right now. :)\r
+\r
+-Bart\r
+\r
+* Jed Brown <jed@59A2.org> [091122 16:26]:\r
+> Currently OR binds more weakly than AND, which is natural in most\r
+> contexts, but I think it is rarely desirably for this sort of search.\r
+> Suppose I am in looking at my inbox and decide to filter by\r
+> \r
+>   term1 OR term2\r
+> \r
+> Notmuch makes the query\r
+> \r
+>   tag:inbox AND term1 OR term2\r
+> \r
+> which is actually\r
+> \r
+>   (tag:inbox AND term1) OR term2\r
+> \r
+> and not at all what I wanted.  Adding the necessary parentheses to\r
+> notmuch-search-filter is trivial but it requires more parentheses for\r
+> the overwhelming majority of searches that I think are more common.\r
+> \r
+> Are most searches indeed closer to conjunctive form?\r
+> \r
+> Should OR bind tighter than AND?\r
+> \r
+> \r
+> Jed\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+-- \r
+                               WebSig: http://www.jukie.net/~bart/sig/\r