[notmuch] [RFC] Precedence of OR and AND
authorJed Brown <jed@59A2.org>
Sun, 22 Nov 2009 21:26:31 +0000 (22:26 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:39 +0000 (09:35 -0800)
2d/f432fef089d883ad55b6103c3d2272b6306e15 [new file with mode: 0644]

diff --git a/2d/f432fef089d883ad55b6103c3d2272b6306e15 b/2d/f432fef089d883ad55b6103c3d2272b6306e15
new file mode 100644 (file)
index 0000000..58b9c06
--- /dev/null
@@ -0,0 +1,81 @@
+Return-Path: <five9a2@gmail.com>\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 0CD29431FBC\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 13:26:04 -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 GmCXGPkD46xC for <notmuch@notmuchmail.org>;\r
+       Sun, 22 Nov 2009 13:26:03 -0800 (PST)\r
+Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com\r
+       [209.85.218.224])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0E391431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 13:26:02 -0800 (PST)\r
+Received: by bwz24 with SMTP id 24so3514164bwz.30\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 13:26:02 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:received:received:sender:from:to:subject:date\r
+       :message-id:mime-version:content-type;\r
+       bh=T9mmwMIomcZBJeF6aUkfTAqMt/Gx00wRsrX+IlUKGWY=;\r
+       b=TXCI5+Epzh/y6F4Nm1JCgJLY1fTXXqTA2XYe13kfyWBnL49fC1inGrC3wFq8yDAXnS\r
+       NtILLxla/sJw3+YAqObjOICxch5viLvo0x4HSv5jQ3shXs6B61R4/Z4Iz/lDPNLF4RSE\r
+       gwQJH1vxzIFxZQ7doKRKwOsuTvotneJ5J53ks=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=sender:from:to:subject:date:message-id:mime-version:content-type;\r
+       b=XCTheAy+ErfMPZQ2p7cbRuYFNBIjpXJioHJCs4A5owYONgJyrnyeuWhXjXJ4Bw8Vtr\r
+       NjY1gbr5dyRYgx2W6VrteFZUsRNI88GjmRcVHvc3pgFpUATKCQpjbYrqY59JUm2XFZJQ\r
+       lUlxbvcgw+k2Fz1Egq7We4lELbMpGfwfGw6hk=\r
+Received: by 10.204.34.3 with SMTP id j3mr3922509bkd.23.1258925161989;\r
+       Sun, 22 Nov 2009 13:26:01 -0800 (PST)\r
+Received: from kunyang (vawpc43.ethz.ch [129.132.59.11])\r
+       by mx.google.com with ESMTPS id y15sm4767743fkd.56.2009.11.22.13.26.00\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Sun, 22 Nov 2009 13:26:01 -0800 (PST)\r
+Sender: Jed Brown <five9a2@gmail.com>\r
+From: Jed Brown <jed@59A2.org>\r
+To: notmuch@notmuchmail.org\r
+Date: Sun, 22 Nov 2009 22:26:31 +0100\r
+Message-ID: <87y6ly45fc.fsf@59A2.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: [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:26:04 -0000\r
+\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