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 11FAC431FBF for ; Wed, 18 Nov 2009 16:08:48 -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 r9eENtqtINSZ for ; Wed, 18 Nov 2009 16:08:46 -0800 (PST) Received: from alice.connectical.com (alice.connectical.com [208.89.208.235]) by olra.theworths.org (Postfix) with ESMTP id 4BC42431FBC for ; Wed, 18 Nov 2009 16:08:46 -0800 (PST) Received: (qmail 23577 invoked from network); 19 Nov 2009 00:08:13 -0000 Received: from 97.126.60.213.dynamic.mundo-r.com (HELO hikari.localdomain) (aperez@213.60.126.97) by alice.connectical.com with ESMTPA; 19 Nov 2009 00:08:13 -0000 Received: by hikari.localdomain (Postfix, from userid 500) id E573D31DCB60; Thu, 19 Nov 2009 01:07:22 +0100 (CET) From: Adrian Perez To: notmuch@notmuchmail.org Date: Thu, 19 Nov 2009 01:07:22 +0100 Message-Id: <1258589242-4871-1-git-send-email-aperez@igalia.com> X-Mailer: git-send-email 1.6.5.2 Subject: [notmuch] [PATCH] Allow lone "not" search operators 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: Thu, 19 Nov 2009 00:08:48 -0000 As suggested by Keith in FLAG_PURE_NOT allows for expressions like: notmuch search NOT tag:inbox Note that this way a search like: notmuch search foobar NOT tag:inbox should not be written instead: notmuch search foobar AND NOT tag:inbox In my opinion, the latter feels more natural and is somewhat more explicit. It gives a better clue of what the search is about instead of assuming that an implicit AND operator is there. --- lib/query.cc | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/query.cc b/lib/query.cc index a869f3e..75f22b3 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -97,7 +97,8 @@ notmuch_query_search_messages (notmuch_query_t *query, Xapian::QueryParser::FLAG_PHRASE | Xapian::QueryParser::FLAG_LOVEHATE | Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE | - Xapian::QueryParser::FLAG_WILDCARD); + Xapian::QueryParser::FLAG_WILDCARD | + Xapian::QueryParser::FLAG_PURE_NOT); if (strcmp (query_string, "") == 0) { final_query = mail_query; -- 1.6.5.2