unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Adrian Perez <aperez@igalia.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] Allow lone "not" search operators
Date: Thu, 19 Nov 2009 01:07:22 +0100	[thread overview]
Message-ID: <1258589242-4871-1-git-send-email-aperez@igalia.com> (raw)

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

             reply	other threads:[~2009-11-19  0:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19  0:07 Adrian Perez [this message]
2009-11-19  0:45 ` [PATCH] Allow lone "not" search operators Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258589242-4871-1-git-send-email-aperez@igalia.com \
    --to=aperez@igalia.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).