1 Return-Path: <aperez@hikari.localdomain>
\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 olra.theworths.org (Postfix) with ESMTP id 11FAC431FBF
\r
6 for <notmuch@notmuchmail.org>; Wed, 18 Nov 2009 16:08:48 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id r9eENtqtINSZ for <notmuch@notmuchmail.org>;
\r
11 Wed, 18 Nov 2009 16:08:46 -0800 (PST)
\r
12 Received: from alice.connectical.com (alice.connectical.com [208.89.208.235])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 4BC42431FBC
\r
14 for <notmuch@notmuchmail.org>; Wed, 18 Nov 2009 16:08:46 -0800 (PST)
\r
15 Received: (qmail 23577 invoked from network); 19 Nov 2009 00:08:13 -0000
\r
16 Received: from 97.126.60.213.dynamic.mundo-r.com (HELO hikari.localdomain)
\r
17 (aperez@213.60.126.97)
\r
18 by alice.connectical.com with ESMTPA; 19 Nov 2009 00:08:13 -0000
\r
19 Received: by hikari.localdomain (Postfix, from userid 500)
\r
20 id E573D31DCB60; Thu, 19 Nov 2009 01:07:22 +0100 (CET)
\r
21 From: Adrian Perez <aperez@igalia.com>
\r
22 To: notmuch@notmuchmail.org
\r
23 Date: Thu, 19 Nov 2009 01:07:22 +0100
\r
24 Message-Id: <1258589242-4871-1-git-send-email-aperez@igalia.com>
\r
25 X-Mailer: git-send-email 1.6.5.2
\r
26 Subject: [notmuch] [PATCH] Allow lone "not" search operators
\r
27 X-BeenThere: notmuch@notmuchmail.org
\r
28 X-Mailman-Version: 2.1.12
\r
30 List-Id: "Use and development of the notmuch mail system."
\r
31 <notmuch.notmuchmail.org>
\r
32 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
33 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
34 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
35 List-Post: <mailto:notmuch@notmuchmail.org>
\r
36 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
37 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
39 X-List-Received-Date: Thu, 19 Nov 2009 00:08:48 -0000
\r
41 As suggested by Keith in FLAG_PURE_NOT allows for expressions like:
\r
43 notmuch search NOT tag:inbox
\r
45 Note that this way a search like:
\r
47 notmuch search foobar NOT tag:inbox
\r
49 should not be written instead:
\r
51 notmuch search foobar AND NOT tag:inbox
\r
53 In my opinion, the latter feels more natural and is somewhat more explicit.
\r
54 It gives a better clue of what the search is about instead of assuming that
\r
55 an implicit AND operator is there.
\r
58 lib/query.cc | 3 ++-
\r
59 1 files changed, 2 insertions(+), 1 deletions(-)
\r
61 diff --git a/lib/query.cc b/lib/query.cc
\r
62 index a869f3e..75f22b3 100644
\r
65 @@ -97,7 +97,8 @@ notmuch_query_search_messages (notmuch_query_t *query,
\r
66 Xapian::QueryParser::FLAG_PHRASE |
\r
67 Xapian::QueryParser::FLAG_LOVEHATE |
\r
68 Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE |
\r
69 - Xapian::QueryParser::FLAG_WILDCARD);
\r
70 + Xapian::QueryParser::FLAG_WILDCARD |
\r
71 + Xapian::QueryParser::FLAG_PURE_NOT);
\r
73 if (strcmp (query_string, "") == 0) {
\r
74 final_query = mail_query;
\r