Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / bc / ca723199f62b1300b44a3e0f2c647801c3c9cd
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 56F0B431FC0\r
6         for <notmuch@notmuchmail.org>; Sat,  3 Mar 2012 05:04:07 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \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 O5F1Nx+G3iCl for <notmuch@notmuchmail.org>;\r
18         Sat,  3 Mar 2012 05:04:05 -0800 (PST)\r
19 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
20  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  DE01F431FDE    for <notmuch@notmuchmail.org>; Sat,  3 Mar 2012 05:04:02 -0800\r
23  (PST)\r
24 Received: by wgbds10 with SMTP id ds10so171103wgb.2\r
25         for <notmuch@notmuchmail.org>; Sat, 03 Mar 2012 05:04:01 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=O6C+JZcOtaI4lvW+H4RgTr4s5UDAihljkrOYOPC37YI=;\r
29         b=PaHsbNmB+djeBNiTzhxyi4V1Ti7gW0wdK3uuF3dlzY7HWvs7LCfrXpnFzoy3bh91H2\r
30         cauM5u7BLiK3vel/b8aDXycdCs0Q8ojBq0HJs/FIUz3py86F5DT0FQt9gEiEqtBBnDzS\r
31         7967qSjhkTH0ZQeFZWjdN0rh5I8tXePsGxUAtHX85VmhbYMJ0Fwvv25McVyjJIehndyL\r
32         k9TVusxFFVULnf/iT0TILIvRohxYVwV3XqbbLFwAeTaSqycxQ1N04OLLQ4Ofa8apWanN\r
33         01K0cM8aSlYOVJVfIZnbNz8gYRWu/3QUgIe7ZdRSu1mZQL0tDyRXRr7EC7vT93EkJ/Pe\r
34         qKyA==\r
35 Received: by 10.180.78.233 with SMTP id e9mr3097892wix.0.1330779841596;\r
36         Sat, 03 Mar 2012 05:04:01 -0800 (PST)\r
37 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
38  [94.192.233.223])      by mx.google.com with ESMTPS id\r
39  fl2sm27089105wib.4.2012.03.03.05.04.00 (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Sat, 03 Mar 2012 05:04:00 -0800 (PST)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 2/5] cli: move count to the new --with-excluded naming scheme.\r
44 Date: Sat,  3 Mar 2012 13:05:15 +0000\r
45 Message-Id: <1330779918-28024-3-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.2.3\r
47 In-Reply-To: <1330779918-28024-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1330779918-28024-1-git-send-email-markwalters1009@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Sat, 03 Mar 2012 13:04:07 -0000\r
62 \r
63 Rename the option --no-exclude to --with-excluded. Note that this\r
64 could be implemented by setting\r
65 notmuch_query_set_with_excluded_messages but it is simpler not to set\r
66 the exclude tags in the first place (the two methods give identical\r
67 output).\r
68 ---\r
69  man/man1/notmuch-count.1 |    4 ++--\r
70  notmuch-count.c          |   11 ++++++-----\r
71  test/count               |    4 ++--\r
72  3 files changed, 10 insertions(+), 9 deletions(-)\r
73 \r
74 diff --git a/man/man1/notmuch-count.1 b/man/man1/notmuch-count.1\r
75 index 805a8ae..5903074 100644\r
76 --- a/man/man1/notmuch-count.1\r
77 +++ b/man/man1/notmuch-count.1\r
78 @@ -41,9 +41,9 @@ Output the number of matching threads.\r
79  \r
80  .RS 4\r
81  .TP 4\r
82 -.BR \-\-no\-exclude\r
83 +.BR \-\-with\-excluded\r
84  \r
85 -Do not exclude the messages matching search.exclude_tags in the config file.\r
86 +Include messages which match search.exclude_tags in the count.\r
87  .RE\r
88  .RE\r
89  .RE\r
90 diff --git a/notmuch-count.c b/notmuch-count.c\r
91 index 46b76ae..b87cdca 100644\r
92 --- a/notmuch-count.c\r
93 +++ b/notmuch-count.c\r
94 @@ -35,7 +35,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
95      char *query_str;\r
96      int opt_index;\r
97      int output = OUTPUT_MESSAGES;\r
98 -    notmuch_bool_t no_exclude = FALSE;\r
99 +    notmuch_bool_t with_excluded = FALSE;\r
100      unsigned int i;\r
101  \r
102      notmuch_opt_desc_t options[] = {\r
103 @@ -43,7 +43,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
104           (notmuch_keyword_t []){ { "threads", OUTPUT_THREADS },\r
105                                   { "messages", OUTPUT_MESSAGES },\r
106                                   { 0, 0 } } },\r
107 -       { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },\r
108 +       { NOTMUCH_OPT_BOOLEAN, &with_excluded, "with-excluded", 'd', 0 },\r
109         { 0, 0, 0, 0, 0 }\r
110      };\r
111  \r
112 @@ -78,7 +78,10 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
113         return 1;\r
114      }\r
115  \r
116 -    if (!no_exclude) {\r
117 +    /* If we have --with-excluded we could use\r
118 +     * notmuch_query_set_with_excluded, but it is simpler not to set\r
119 +     * the exclude tags in the first place */\r
120 +    if (!with_excluded) {\r
121         const char **search_exclude_tags;\r
122         size_t search_exclude_tags_length;\r
123  \r
124 @@ -88,8 +91,6 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
125             notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);\r
126      }\r
127  \r
128 -    notmuch_query_set_omit_excluded_messages (query, TRUE);\r
129 -\r
130      switch (output) {\r
131      case OUTPUT_MESSAGES:\r
132         printf ("%u\n", notmuch_query_count_messages (query));\r
133 diff --git a/test/count b/test/count\r
134 index 976fff1..f74413b 100755\r
135 --- a/test/count\r
136 +++ b/test/count\r
137 @@ -53,9 +53,9 @@ test_expect_equal \\r
138      "1" \\r
139      "`notmuch count subject:deleted and tag:deleted`"\r
140  \r
141 -test_begin_subtest "count \"deleted\" messages, with --no-exclude"\r
142 +test_begin_subtest "count \"deleted\" messages, with --with-excluded"\r
143  test_expect_equal \\r
144      "3" \\r
145 -    "`notmuch count --no-exclude subject:deleted`"\r
146 +    "`notmuch count --with-excluded subject:deleted`"\r
147  \r
148  test_done\r
149 -- \r
150 1.7.2.3\r
151 \r