[PATCH v2 7/8] lib: add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t
authorMark Walters <markwalters1009@gmail.com>
Sat, 11 May 2013 19:50:08 +0000 (20:50 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:54:41 +0000 (09:54 -0800)
59/61918380275d1edf83d751d729c50ee96de9e6 [new file with mode: 0644]

diff --git a/59/61918380275d1edf83d751d729c50ee96de9e6 b/59/61918380275d1edf83d751d729c50ee96de9e6
new file mode 100644 (file)
index 0000000..f5aa351
--- /dev/null
@@ -0,0 +1,120 @@
+Return-Path: <markwalters1009@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 D9890431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 11 May 2013 12:51:05 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 1ib3ImFTFC-2 for <notmuch@notmuchmail.org>;\r
+       Sat, 11 May 2013 12:51:01 -0700 (PDT)\r
+Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com\r
+       [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id ACD26431FDD\r
+       for <notmuch@notmuchmail.org>; Sat, 11 May 2013 12:50:31 -0700 (PDT)\r
+Received: by mail-wi0-f173.google.com with SMTP id hi5so281109wib.12\r
+       for <notmuch@notmuchmail.org>; Sat, 11 May 2013 12:50:30 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+       :references; bh=981UU8GE8YiXCbx03ngSal7tvfZmodaJoP/W04TkoKE=;\r
+       b=wKyAayTVuMpaE9UTy3Blcv9b2E/KKX/ueuCi+4Ie6UTjOyeqK24wttD2j6m06t9OfH\r
+       SU5/aFv5nwd68ajKQyYUx1/9Vo0bEi8D5PfKa8za/xmq61kjLe/Rl3vQadSqAH8GXNo+\r
+       HdCEM9bJ/Z4jqU5NDDvQlHaAp4PziZ3yZL7OpMQMYxdszN3HLYx2kevYkPkBzqTD1Z3O\r
+       67qWQeWX148Ioo0TxwzhIBlpIUdOTThr/Ymtv1aF9HQijzWu5iW+fMWeqm3dvZTAasMy\r
+       YZaxd0QQhsPP7ULN+/0tvf5h3M4t66WIrGHFPqcS4lHxBpCIX2/Yy5iF9stC4tZzoBWB\r
+       x3/Q==\r
+X-Received: by 10.194.61.45 with SMTP id m13mr31461375wjr.20.1368301830645;\r
+       Sat, 11 May 2013 12:50:30 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id ek7sm5689751wic.4.2013.05.11.12.50.29\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sat, 11 May 2013 12:50:30 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 7/8] lib: add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t\r
+Date: Sat, 11 May 2013 20:50:08 +0100\r
+Message-Id: <1368301809-12532-8-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1368301809-12532-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1368301809-12532-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Sat, 11 May 2013 19:51:06 -0000\r
+\r
+From: Peter Wang <novalazy@gmail.com>\r
+\r
+Add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t so that it can\r
+cover all four values of search --exclude in the cli.\r
+---\r
+ lib/notmuch.h    |    1 +\r
+ lib/query.cc     |    6 ++++--\r
+ notmuch-search.c |    2 +-\r
+ 3 files changed, 6 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/lib/notmuch.h b/lib/notmuch.h\r
+index 27b43ff..35795bb 100644\r
+--- a/lib/notmuch.h\r
++++ b/lib/notmuch.h\r
+@@ -504,6 +504,7 @@ notmuch_query_get_query_string (notmuch_query_t *query);\r
+ typedef enum {\r
+     NOTMUCH_EXCLUDE_FALSE,\r
+     NOTMUCH_EXCLUDE_TRUE,\r
++    NOTMUCH_EXCLUDE_FLAG,\r
+     NOTMUCH_EXCLUDE_ALL\r
+ } notmuch_exclude_t;\r
\r
+diff --git a/lib/query.cc b/lib/query.cc\r
+index 1cc768f..e61d11e 100644\r
+--- a/lib/query.cc\r
++++ b/lib/query.cc\r
+@@ -221,10 +221,12 @@ notmuch_query_search_messages (notmuch_query_t *query)\r
+       if (query->exclude_terms) {\r
+           exclude_query = _notmuch_exclude_tags (query, final_query);\r
\r
+-          if (query->omit_excluded != NOTMUCH_EXCLUDE_FALSE)\r
++          if (query->omit_excluded == NOTMUCH_EXCLUDE_TRUE ||\r
++              query->omit_excluded == NOTMUCH_EXCLUDE_ALL)\r
++          {\r
+               final_query = Xapian::Query (Xapian::Query::OP_AND_NOT,\r
+                                            final_query, exclude_query);\r
+-          else {\r
++          } else {\r
+               exclude_query = Xapian::Query (Xapian::Query::OP_AND,\r
+                                          exclude_query, final_query);\r
\r
+diff --git a/notmuch-search.c b/notmuch-search.c\r
+index 4323201..a20791a 100644\r
+--- a/notmuch-search.c\r
++++ b/notmuch-search.c\r
+@@ -411,7 +411,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
+       for (i = 0; i < search_exclude_tags_length; i++)\r
+           notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);\r
+       if (exclude == EXCLUDE_FLAG)\r
+-          notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_FALSE);\r
++          notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_FLAG);\r
+       if (exclude == EXCLUDE_ALL)\r
+           notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_ALL);\r
+     }\r
+-- \r
+1.7.9.1\r
+\r