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 295B0431FD5
\r
6 for <notmuch@notmuchmail.org>; Thu, 1 Mar 2012 14:29:08 -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 TWWHZ50v4M8v for <notmuch@notmuchmail.org>;
\r
18 Thu, 1 Mar 2012 14:29:07 -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 64998431FAE
\r
23 for <notmuch@notmuchmail.org>; Thu, 1 Mar 2012 14:29:07 -0800 (PST)
\r
24 Received: by wico1 with SMTP id o1so305757wic.26
\r
25 for <notmuch@notmuchmail.org>; Thu, 01 Mar 2012 14:29:06 -0800 (PST)
\r
26 Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates
\r
27 10.180.87.8 as permitted sender) client-ip=10.180.87.8;
\r
28 Authentication-Results: mr.google.com; spf=pass (google.com: domain of
\r
29 markwalters1009@gmail.com designates 10.180.87.8 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.87.8])
\r
33 by 10.180.87.8 with SMTP id t8mr6519078wiz.15.1330640946434 (num_hops =
\r
34 1); Thu, 01 Mar 2012 14:29:06 -0800 (PST)
\r
35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
36 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
37 bh=zzl454coS2NIx5EXcdeh/hMrVJ/yjbqcmYG6U/x2PIk=;
\r
38 b=jKlIlsxhZVRm+GL3jDlUcuNgGu31KQrFpA3XVkCOWJUsefwEagLsbNwQ3HJOOWuWR9
\r
39 RWTCYlTuas26Ol0aTUGoLZbvefgEAR9o1/DMcKTNmNcRONtx8Ge8igy+/twq5r/0Uicg
\r
40 9XD1zxTM6XqPr+z333b3zpufLUA1b4Mz5fh0rTfLrg6XSEx83kjXUlZu1NUJL/KVYEdc
\r
41 FcH0febZZXKPN1zozQX3oTP5eWv/emoyc2i2WR9Wmbg6vcXpM/J3tKLOUv+gfr5Y/ikd
\r
42 +/6td/6onNaTz+UQaErftPll18Pcph2nNOSM6oOmJXoCrS0fDRsEMMt2GxOCaiFdC9d0
\r
44 Received: by 10.180.87.8 with SMTP id t8mr5261605wiz.15.1330640946335;
\r
45 Thu, 01 Mar 2012 14:29:06 -0800 (PST)
\r
46 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.
\r
47 [94.192.233.223]) by mx.google.com with ESMTPS id
\r
48 cc3sm16539306wib.7.2012.03.01.14.29.04 (version=TLSv1/SSLv3 cipher=OTHER);
\r
49 Thu, 01 Mar 2012 14:29:05 -0800 (PST)
\r
50 From: Mark Walters <markwalters1009@gmail.com>
\r
51 To: notmuch@notmuchmail.org
\r
52 Subject: [Patch v7 01/13] cli: add --no-exclude option to count and search.
\r
53 Date: Thu, 1 Mar 2012 22:30:33 +0000
\r
54 Message-Id: <1330641045-27416-2-git-send-email-markwalters1009@gmail.com>
\r
55 X-Mailer: git-send-email 1.7.2.3
\r
56 In-Reply-To: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com>
\r
57 References: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com>
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Thu, 01 Mar 2012 22:29:08 -0000
\r
72 This option turns off the exclusion so all matching messages are
\r
73 returned. We do not need to add this to notmuch-show as that does not
\r
76 notmuch-count.c | 17 +++++++++++------
\r
77 notmuch-search.c | 17 +++++++++++------
\r
78 2 files changed, 22 insertions(+), 12 deletions(-)
\r
80 diff --git a/notmuch-count.c b/notmuch-count.c
\r
81 index 63459fb..5364507 100644
\r
82 --- a/notmuch-count.c
\r
83 +++ b/notmuch-count.c
\r
84 @@ -35,8 +35,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
87 int output = OUTPUT_MESSAGES;
\r
88 - const char **search_exclude_tags;
\r
89 - size_t search_exclude_tags_length;
\r
90 + notmuch_bool_t no_exclude = FALSE;
\r
93 notmuch_opt_desc_t options[] = {
\r
94 @@ -44,6 +43,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
95 (notmuch_keyword_t []){ { "threads", OUTPUT_THREADS },
\r
96 { "messages", OUTPUT_MESSAGES },
\r
98 + { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },
\r
102 @@ -78,10 +78,15 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
106 - search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
107 - (config, &search_exclude_tags_length);
\r
108 - for (i = 0; i < search_exclude_tags_length; i++)
\r
109 - notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
110 + if (!no_exclude) {
\r
111 + const char **search_exclude_tags;
\r
112 + size_t search_exclude_tags_length;
\r
114 + search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
115 + (config, &search_exclude_tags_length);
\r
116 + for (i = 0; i < search_exclude_tags_length; i++)
\r
117 + notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
121 case OUTPUT_MESSAGES:
\r
122 diff --git a/notmuch-search.c b/notmuch-search.c
\r
123 index 92ce38a..6d6c0e6 100644
\r
124 --- a/notmuch-search.c
\r
125 +++ b/notmuch-search.c
\r
126 @@ -426,8 +426,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
127 output_t output = OUTPUT_SUMMARY;
\r
129 int limit = -1; /* unlimited */
\r
130 - const char **search_exclude_tags;
\r
131 - size_t search_exclude_tags_length;
\r
132 + notmuch_bool_t no_exclude = FALSE;
\r
135 enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }
\r
136 @@ -449,6 +448,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
137 { "files", OUTPUT_FILES },
\r
138 { "tags", OUTPUT_TAGS },
\r
140 + { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },
\r
141 { NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 },
\r
142 { NOTMUCH_OPT_INT, &limit, "limit", 'L', 0 },
\r
144 @@ -496,10 +496,15 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
146 notmuch_query_set_sort (query, sort);
\r
148 - search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
149 - (config, &search_exclude_tags_length);
\r
150 - for (i = 0; i < search_exclude_tags_length; i++)
\r
151 - notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
152 + if (!no_exclude) {
\r
153 + const char **search_exclude_tags;
\r
154 + size_t search_exclude_tags_length;
\r
156 + search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
157 + (config, &search_exclude_tags_length);
\r
158 + for (i = 0; i < search_exclude_tags_length; i++)
\r
159 + notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r