1 Return-Path: <wking@tremily.us>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id CF0836DE1A3A
\r
6 for <notmuch@notmuchmail.org>; Fri, 1 Jan 2016 22:09:56 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0.042 tagged_above=-999 required=5 tests=[AWL=0.043,
\r
13 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001,
\r
14 SPF_PASS=-0.001] autolearn=disabled
\r
15 Received: from arlo.cworth.org ([127.0.0.1])
\r
16 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id jLmU1MdYz0ty for <notmuch@notmuchmail.org>;
\r
18 Fri, 1 Jan 2016 22:09:53 -0800 (PST)
\r
19 Received: from resqmta-po-06v.sys.comcast.net (resqmta-po-06v.sys.comcast.net
\r
21 by arlo.cworth.org (Postfix) with ESMTPS id 596366DE1830
\r
22 for <notmuch@notmuchmail.org>; Fri, 1 Jan 2016 22:09:48 -0800 (PST)
\r
23 Received: from resomta-po-11v.sys.comcast.net ([96.114.154.235])
\r
24 by resqmta-po-06v.sys.comcast.net with comcast
\r
25 id 0u9U1s00254zqzk01u9mMQ; Sat, 02 Jan 2016 06:09:46 +0000
\r
26 Received: from mail.tremily.us ([73.221.72.168])
\r
27 by resomta-po-11v.sys.comcast.net with comcast
\r
28 id 0u7k1s0033dr3C901u7kfW; Sat, 02 Jan 2016 06:07:45 +0000
\r
29 Received: from ullr.tremily.us (unknown [192.168.10.7])
\r
30 by mail.tremily.us (Postfix) with ESMTPS id E35841B2F577;
\r
31 Fri, 1 Jan 2016 22:07:43 -0800 (PST)
\r
32 Received: (nullmailer pid 15115 invoked by uid 1000);
\r
33 Sat, 02 Jan 2016 06:07:51 -0000
\r
34 From: "W. Trevor King" <wking@tremily.us>
\r
35 To: notmuch@notmuchmail.org
\r
36 Cc: David Bremner <david@tethera.net>,
\r
37 Tomi Ollila <tomi.ollila@iki.fi>, Jani Nikula <jani@nikula.org>,
\r
38 Carl Worth <cworth@cworth.org>, "W. Trevor King" <wking@tremily.us>
\r
39 Subject: [PATCH v2 3/4] nmbug-status: Wrap query phrases in parentheses when
\r
41 Date: Fri, 1 Jan 2016 22:07:42 -0800
\r
43 <a82a76a738a823df9b56c25e9b34d9523d5d4395.1451683912.git.wking@tremily.us>
\r
44 X-Mailer: git-send-email 2.1.0.60.g85f0837
\r
45 In-Reply-To: <cover.1451683912.git.wking@tremily.us>
\r
46 References: <cover.1451683912.git.wking@tremily.us>
\r
47 In-Reply-To: <cover.1451683912.git.wking@tremily.us>
\r
48 References: <cover.1451683912.git.wking@tremily.us>
\r
49 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
50 s=q20140121; t=1451714986;
\r
51 bh=EsWtt64FdfG0VjYB6cAEuXizbJYNPg+zTVeSeV5aqjs=;
\r
52 h=Received:Received:Received:Received:From:To:Subject:Date:
\r
54 b=rmnOAFJyO9Hk2kN1jKsE0gN1r9Y6oJstHlAC4M1oI1uF1uNCCw2jJqhKU6IAOL1j5
\r
55 5QErpH5NffRQa4pL0T9MwF1NBHBncy0Vrxd5i5cZtrg4BvoWZqpyKMahGjjxutEgY0
\r
56 MX8b/puiTVMQvjMtl/xewAoqnJJtgyf+6orhmuKTvuqo3YD1JhwHf7uE/J4y5dVq8q
\r
57 WNcJSlbHfRXzpmqkG+TP4ugQzm2k2d+aBQmnNAX4mpenXSi/An0J3/71ZSGuUG8guQ
\r
58 kiBQsqHUiRXLaeSI/L3Rd/GdJ2oEzbiSJL8UK9TB8Y3bJdC9DFBs09K/HjoSlhLRGy
\r
60 X-BeenThere: notmuch@notmuchmail.org
\r
61 X-Mailman-Version: 2.1.20
\r
63 List-Id: "Use and development of the notmuch mail system."
\r
64 <notmuch.notmuchmail.org>
\r
65 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
68 List-Post: <mailto:notmuch@notmuchmail.org>
\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
70 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
72 X-List-Received-Date: Sat, 02 Jan 2016 06:09:57 -0000
\r
76 "query": ["tag:a", "tag:b or tag:c"]
\r
78 is now converted to:
\r
80 ( tag:a ) and ( tag:b or tag:c )
\r
84 tag:a and tag:b or tag:c
\r
86 This helps us avoid confusion due to Xapian's higher-precedence AND
\r
87 [1], where the old query would be interpreted as:
\r
89 ( tag:a and tag:b ) or tag:c
\r
91 [1]: http://xapian.org/docs/queryparser.html
\r
94 devel/nmbug/nmbug-status | 5 +++--
\r
95 2 files changed, 6 insertions(+), 2 deletions(-)
\r
97 diff --git a/NEWS b/NEWS
\r
98 index 9f2e860..403a046 100644
\r
101 @@ -4,6 +4,9 @@ Notmuch 0.22 (UNRELEASED)
\r
105 +`nmbug-status` now wraps query phrases in parentheses when and-ing
\r
106 +them together, to avoid confusion about clause grouping.
\r
108 `nmbug-status` now supports `meta.message-url` to override the Gmane
\r
109 template. For example, you can use:
\r
111 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status
\r
112 index d72f1db..7d3a76e 100755
\r
113 --- a/devel/nmbug/nmbug-status
\r
114 +++ b/devel/nmbug/nmbug-status
\r
115 @@ -167,7 +167,8 @@ class Page (object):
\r
116 view['title'], sort_key))
\r
117 if 'query-string' not in view:
\r
118 query = view['query']
\r
119 - view['query-string'] = ' and '.join(query)
\r
120 + view['query-string'] = ' and '.join(
\r
121 + '( {} )'.format(q) for q in query)
\r
122 q = notmuch.Query(database, view['query-string'])
\r
124 threads = self._get_threads(messages=q.search_messages())
\r
125 @@ -411,7 +412,7 @@ if args.list_views:
\r
126 elif args.get_query != None:
\r
127 for view in config['views']:
\r
128 if args.get_query == view['title']:
\r
129 - print(' and '.join(view['query']))
\r
130 + print(' and '.join('( {} )'.format(q) for q in view['query']))
\r
133 # only import notmuch if needed
\r