RE: Reply all - issue
[notmuch-archives.git] / 8b / 692045c41bf30a6a3d30ca1d3bc20fa264c51a
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 1EB3B429E29\r
6         for <notmuch@notmuchmail.org>; Fri,  6 Apr 2012 05:49:24 -0700 (PDT)\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 nnzT1aCQwuEX for <notmuch@notmuchmail.org>;\r
18         Fri,  6 Apr 2012 05:49:21 -0700 (PDT)\r
19 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
20         [74.125.82.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 DB3A9431FD6\r
23         for <notmuch@notmuchmail.org>; Fri,  6 Apr 2012 05:49:17 -0700 (PDT)\r
24 Received: by werm13 with SMTP id m13so1667174wer.26\r
25         for <notmuch@notmuchmail.org>; Fri, 06 Apr 2012 05:49:16 -0700 (PDT)\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=yq8Vk74zuiGLhnHZbw3u4pLV1o6O6YCaUEmj30DXz3o=;\r
29         b=gIj2UGIzaZdqM9c7urW0fSRXMhX1n8mMPwQ04+UZDZWKKGJrsHY/8LILQm2bG9NK8d\r
30         gTvZ8D7Dyi/8t6m3Dvwxw9t+Ck0ezyomhG56rZ0IRGwBwcpdigQDkcHv+wnE/hfLBZ0f\r
31         WKFXize6fBg7uOKd6yzPBPjkGtCn/73EWAdy+AA3kSSKADzZSZF9WPFzriqKs9Xn4d7F\r
32         /10VNYCH3SvzSeDjnR9i4gLDGu7QPhPSHLeSnJ86JFcXOdBdF2VzNq8Wcm78q2aV4jCp\r
33         V3hgGZijTYYLaAcvwqqbq+u8+nsVnqCPALd6ev475M6KsB8H2Vmhtukbb5GAeZOzs4HA\r
34         DRwg==\r
35 Received: by 10.180.85.70 with SMTP id f6mr19775492wiz.5.1333716556639;\r
36         Fri, 06 Apr 2012 05:49:16 -0700 (PDT)\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  fn2sm10217723wib.0.2012.04.06.05.49.15 (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Fri, 06 Apr 2012 05:49:16 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH v3 2/6] cli: move count to the new --exclude=(true|false|flag)\r
44         naming scheme.\r
45 Date: Fri,  6 Apr 2012 13:49:07 +0100\r
46 Message-Id: <1333716551-29153-3-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1333716551-29153-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1333716551-29153-1-git-send-email-markwalters1009@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Fri, 06 Apr 2012 12:49:24 -0000\r
63 \r
64 Move the option --no-exclude to the --exclude= scheme. Since there is\r
65 no way to flag messages only true and false are implemented. Note\r
66 that, for consistency with other commands, this is implemented as a\r
67 keyword option rather than a boolean option.\r
68 ---\r
69  man/man1/notmuch-count.1 |    5 +++--\r
70  notmuch-count.c          |   17 ++++++++++++-----\r
71  test/count               |    4 ++--\r
72  3 files changed, 17 insertions(+), 9 deletions(-)\r
73 \r
74 diff --git a/man/man1/notmuch-count.1 b/man/man1/notmuch-count.1\r
75 index 35ecc53..d6cbf07 100644\r
76 --- a/man/man1/notmuch-count.1\r
77 +++ b/man/man1/notmuch-count.1\r
78 @@ -41,9 +41,10 @@ Output the number of matching threads.\r
79  \r
80  .RS 4\r
81  .TP 4\r
82 -.BR \-\-no\-exclude\r
83 +.BR \-\-exclude=(true|false)\r
84  \r
85 -Do not exclude the messages matching search.exclude_tags in the config file.\r
86 +Specify whether to omit messages matching search.tag_exclude from the\r
87 +count (the default) or not.\r
88  .RE\r
89  .RE\r
90  .RE\r
91 diff --git a/notmuch-count.c b/notmuch-count.c\r
92 index 46b76ae..b76690c 100644\r
93 --- a/notmuch-count.c\r
94 +++ b/notmuch-count.c\r
95 @@ -26,6 +26,12 @@ enum {\r
96      OUTPUT_MESSAGES,\r
97  };\r
98  \r
99 +/* The following is to allow future options to be added more easily */\r
100 +enum {\r
101 +    EXCLUDE_TRUE,\r
102 +    EXCLUDE_FALSE,\r
103 +};\r
104 +\r
105  int\r
106  notmuch_count_command (void *ctx, int argc, char *argv[])\r
107  {\r
108 @@ -35,7 +41,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
109      char *query_str;\r
110      int opt_index;\r
111      int output = OUTPUT_MESSAGES;\r
112 -    notmuch_bool_t no_exclude = FALSE;\r
113 +    int exclude = EXCLUDE_TRUE;\r
114      unsigned int i;\r
115  \r
116      notmuch_opt_desc_t options[] = {\r
117 @@ -43,7 +49,10 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
118           (notmuch_keyword_t []){ { "threads", OUTPUT_THREADS },\r
119                                   { "messages", OUTPUT_MESSAGES },\r
120                                   { 0, 0 } } },\r
121 -       { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },\r
122 +       { NOTMUCH_OPT_KEYWORD, &exclude, "exclude", 'x',\r
123 +         (notmuch_keyword_t []){ { "true", EXCLUDE_TRUE },\r
124 +                                 { "false", EXCLUDE_FALSE },\r
125 +                                 { 0, 0 } } },\r
126         { 0, 0, 0, 0, 0 }\r
127      };\r
128  \r
129 @@ -78,7 +87,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
130         return 1;\r
131      }\r
132  \r
133 -    if (!no_exclude) {\r
134 +    if (exclude == EXCLUDE_TRUE) {\r
135         const char **search_exclude_tags;\r
136         size_t search_exclude_tags_length;\r
137  \r
138 @@ -88,8 +97,6 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
139             notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);\r
140      }\r
141  \r
142 -    notmuch_query_set_omit_excluded_messages (query, TRUE);\r
143 -\r
144      switch (output) {\r
145      case OUTPUT_MESSAGES:\r
146         printf ("%u\n", notmuch_query_count_messages (query));\r
147 diff --git a/test/count b/test/count\r
148 index b97fc06..fd387e5 100755\r
149 --- a/test/count\r
150 +++ b/test/count\r
151 @@ -53,9 +53,9 @@ test_expect_equal \\r
152      "1" \\r
153      "`notmuch count subject:deleted and tag:deleted`"\r
154  \r
155 -test_begin_subtest "count \"deleted\" messages, with --no-exclude"\r
156 +test_begin_subtest "count \"deleted\" messages, --exclude=false"\r
157  test_expect_equal \\r
158      "3" \\r
159 -    "`notmuch count --no-exclude subject:deleted`"\r
160 +    "`notmuch count --exclude=false subject:deleted`"\r
161  \r
162  test_done\r
163 -- \r
164 1.7.9.1\r
165 \r