1 Return-Path: <markwalters1009@gmail.com>
\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 DB18C431FBD
\r
6 for <notmuch@notmuchmail.org>; Sat, 25 Feb 2012 21:56:06 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id Kz+qFR0a1LA6 for <notmuch@notmuchmail.org>;
\r
18 Sat, 25 Feb 2012 21:56:06 -0800 (PST)
\r
19 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com
\r
20 [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 232EF431FAE
\r
23 for <notmuch@notmuchmail.org>; Sat, 25 Feb 2012 21:56:06 -0800 (PST)
\r
24 Received: by wibhi8 with SMTP id hi8so2574099wib.26
\r
25 for <notmuch@notmuchmail.org>; Sat, 25 Feb 2012 21:56:04 -0800 (PST)
\r
26 Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates
\r
27 10.180.93.4 as permitted sender) client-ip=10.180.93.4;
\r
28 Authentication-Results: mr.google.com; spf=pass (google.com: domain of
\r
29 markwalters1009@gmail.com designates 10.180.93.4 as permitted
\r
30 sender) smtp.mail=markwalters1009@gmail.com;
\r
31 dkim=pass header.i=markwalters1009@gmail.com
\r
32 Received: from mr.google.com ([10.180.93.4])
\r
33 by 10.180.93.4 with SMTP id cq4mr17546189wib.21.1330235764883 (num_hops
\r
34 = 1); Sat, 25 Feb 2012 21:56:04 -0800 (PST)
\r
35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
36 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
37 bh=32u4Sqkf3c2vTKAu3GWUtRncCIw3Eni0kEUjiTfP6JE=;
\r
38 b=N9bYubZFPh6AE7Vb/7502mSg17QSnpDjbE4ib6VfE/G7R89UUmKz2+owKV57JJNstw
\r
39 VOevf0AfIsftdiK8u2yzToRFe70flz8O5K+Fb7TiAAMUrBNwvHX/5LwgxudZ/85koSW5
\r
40 ysAk3VsC+Can+EzCycT7o8WKhkizsltkQlmJ0=
\r
41 Received: by 10.180.93.4 with SMTP id cq4mr9148368wib.21.1330157127140;
\r
42 Sat, 25 Feb 2012 00:05:27 -0800 (PST)
\r
43 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.
\r
44 [94.192.233.223]) by mx.google.com with ESMTPS id
\r
45 hs6sm20687559wib.2.2012.02.25.00.05.25 (version=TLSv1/SSLv3 cipher=OTHER);
\r
46 Sat, 25 Feb 2012 00:05:26 -0800 (PST)
\r
47 From: Mark Walters <markwalters1009@gmail.com>
\r
48 To: notmuch@notmuchmail.org,
\r
49 Austin Clements <amdragon@MIT.EDU>
\r
50 Subject: [Patch v6 01/13] cli: add --no-exclude option to count and search.
\r
51 Date: Sat, 25 Feb 2012 08:06:32 +0000
\r
52 Message-Id: <1330157204-26094-2-git-send-email-markwalters1009@gmail.com>
\r
53 X-Mailer: git-send-email 1.7.2.3
\r
54 In-Reply-To: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com>
\r
55 References: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com>
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.13
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Sun, 26 Feb 2012 05:56:07 -0000
\r
70 This option turns off the exclusion so all matching messages are
\r
71 returned. We do not need to add this to notmuch-show as that does not
\r
74 notmuch-count.c | 17 +++++++++++------
\r
75 notmuch-search.c | 17 +++++++++++------
\r
76 2 files changed, 22 insertions(+), 12 deletions(-)
\r
78 diff --git a/notmuch-count.c b/notmuch-count.c
\r
79 index 63459fb..5364507 100644
\r
80 --- a/notmuch-count.c
\r
81 +++ b/notmuch-count.c
\r
82 @@ -35,8 +35,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
85 int output = OUTPUT_MESSAGES;
\r
86 - const char **search_exclude_tags;
\r
87 - size_t search_exclude_tags_length;
\r
88 + notmuch_bool_t no_exclude = FALSE;
\r
91 notmuch_opt_desc_t options[] = {
\r
92 @@ -44,6 +43,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
93 (notmuch_keyword_t []){ { "threads", OUTPUT_THREADS },
\r
94 { "messages", OUTPUT_MESSAGES },
\r
96 + { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },
\r
100 @@ -78,10 +78,15 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
104 - search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
105 - (config, &search_exclude_tags_length);
\r
106 - for (i = 0; i < search_exclude_tags_length; i++)
\r
107 - notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
108 + if (!no_exclude) {
\r
109 + const char **search_exclude_tags;
\r
110 + size_t search_exclude_tags_length;
\r
112 + search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
113 + (config, &search_exclude_tags_length);
\r
114 + for (i = 0; i < search_exclude_tags_length; i++)
\r
115 + notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
119 case OUTPUT_MESSAGES:
\r
120 diff --git a/notmuch-search.c b/notmuch-search.c
\r
121 index d504051..d1c5553 100644
\r
122 --- a/notmuch-search.c
\r
123 +++ b/notmuch-search.c
\r
124 @@ -423,8 +423,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
125 output_t output = OUTPUT_SUMMARY;
\r
127 int limit = -1; /* unlimited */
\r
128 - const char **search_exclude_tags;
\r
129 - size_t search_exclude_tags_length;
\r
130 + notmuch_bool_t no_exclude = FALSE;
\r
133 enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }
\r
134 @@ -446,6 +445,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
135 { "files", OUTPUT_FILES },
\r
136 { "tags", OUTPUT_TAGS },
\r
138 + { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },
\r
139 { NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 },
\r
140 { NOTMUCH_OPT_INT, &limit, "limit", 'L', 0 },
\r
142 @@ -493,10 +493,15 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
144 notmuch_query_set_sort (query, sort);
\r
146 - search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
147 - (config, &search_exclude_tags_length);
\r
148 - for (i = 0; i < search_exclude_tags_length; i++)
\r
149 - notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
150 + if (!no_exclude) {
\r
151 + const char **search_exclude_tags;
\r
152 + size_t search_exclude_tags_length;
\r
154 + search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
155 + (config, &search_exclude_tags_length);
\r
156 + for (i = 0; i < search_exclude_tags_length; i++)
\r
157 + notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r