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 38B4F431FDB
\r
6 for <notmuch@notmuchmail.org>; Thu, 2 Feb 2012 09:43:38 -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 FRR3kzRwo01z for <notmuch@notmuchmail.org>;
\r
18 Thu, 2 Feb 2012 09:43:37 -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 C4B65429E29 for <notmuch@notmuchmail.org>; Thu, 2 Feb 2012 09:43:18 -0800
\r
24 Received: by mail-ww0-f45.google.com with SMTP id dt12so2522817wgb.2
\r
25 for <notmuch@notmuchmail.org>; Thu, 02 Feb 2012 09:43:18 -0800 (PST)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=O97wCa0n7XsK6R6wcr4EphxC/rgAff6CB3dulJaU7Ns=;
\r
29 b=PNUpNBzjfIDsUCqOOsagne/SDF5xz27y9zTFg0emwlSHRwmagg9JTyMqbJVlFzwG14
\r
30 nOeesn5hqWKK3J3q6ZxjF50JyBUOsXrQCwtu1Ugyh4dQ385KSrHaBSBPdOwFnDuoM72F
\r
31 SHNRCRVRGlL4TUPC8bF15awpG8LY9cWo7XdrU=
\r
32 Received: by 10.180.100.228 with SMTP id fb4mr6263865wib.1.1328204598461;
\r
33 Thu, 02 Feb 2012 09:43:18 -0800 (PST)
\r
34 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.
\r
35 [94.192.233.223]) by mx.google.com with ESMTPS id
\r
36 q2sm1127404wiy.7.2012.02.02.09.43.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu,
\r
37 02 Feb 2012 09:43:17 -0800 (PST)
\r
38 From: Mark Walters <markwalters1009@gmail.com>
\r
39 To: notmuch@notmuchmail.org,
\r
41 Subject: [PATCH v4 10/11] cli: omit excluded messages in results where
\r
43 Date: Thu, 2 Feb 2012 17:43:38 +0000
\r
44 Message-Id: <1328204619-25046-10-git-send-email-markwalters1009@gmail.com>
\r
45 X-Mailer: git-send-email 1.7.2.3
\r
46 In-Reply-To: <874nv9rv79.fsf@qmul.ac.uk>
\r
47 References: <874nv9rv79.fsf@qmul.ac.uk>
\r
48 X-BeenThere: notmuch@notmuchmail.org
\r
49 X-Mailman-Version: 2.1.13
\r
51 List-Id: "Use and development of the notmuch mail system."
\r
52 <notmuch.notmuchmail.org>
\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
56 List-Post: <mailto:notmuch@notmuchmail.org>
\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
60 X-List-Received-Date: Thu, 02 Feb 2012 17:43:38 -0000
\r
62 In all cases of notmuch count/search/show where the results returned
\r
63 cannot reflect the exclude flag return just the matched not-excluded
\r
64 results. If the caller wishes to have all the matched results (i.e.,
\r
65 including the excluded ones) they should call with the
\r
66 --no-exclude option.
\r
68 The relevant cases are
\r
69 count: both threads and messages
\r
70 search: all cases except the summary view
\r
73 notmuch-count.c | 2 ++
\r
74 notmuch-search.c | 9 +++++++++
\r
75 notmuch-show.c | 5 +++++
\r
76 3 files changed, 16 insertions(+), 0 deletions(-)
\r
78 diff --git a/notmuch-count.c b/notmuch-count.c
\r
79 index 5364507..46b76ae 100644
\r
80 --- a/notmuch-count.c
\r
81 +++ b/notmuch-count.c
\r
82 @@ -88,6 +88,8 @@ notmuch_count_command (void *ctx, int argc, char *argv[])
\r
83 notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
86 + notmuch_query_set_omit_excluded_messages (query, TRUE);
\r
89 case OUTPUT_MESSAGES:
\r
90 printf ("%u\n", notmuch_query_count_messages (query));
\r
91 diff --git a/notmuch-search.c b/notmuch-search.c
\r
92 index 43ec90b..d2b2488 100644
\r
93 --- a/notmuch-search.c
\r
94 +++ b/notmuch-search.c
\r
95 @@ -207,6 +207,9 @@ do_search_threads (const search_format_t *format,
\r
96 int first_thread = 1;
\r
99 + if (output == OUTPUT_THREADS)
\r
100 + notmuch_query_set_omit_excluded_messages (query, TRUE);
\r
103 offset += notmuch_query_count_threads (query);
\r
105 @@ -297,6 +300,8 @@ do_search_messages (const search_format_t *format,
\r
106 int first_message = 1;
\r
109 + notmuch_query_set_omit_excluded_messages (query, TRUE);
\r
112 offset += notmuch_query_count_messages (query);
\r
114 @@ -368,6 +373,10 @@ do_search_tags (notmuch_database_t *notmuch,
\r
118 + notmuch_query_set_omit_excluded_messages (query, TRUE);
\r
119 + /* should the following only special case if no excluded terms
\r
122 /* Special-case query of "*" for better performance. */
\r
123 if (strcmp (notmuch_query_get_query_string (query), "*") == 0) {
\r
124 tags = notmuch_database_get_all_tags (notmuch);
\r
125 diff --git a/notmuch-show.c b/notmuch-show.c
\r
126 index 108f13b..924e7ea 100644
\r
127 --- a/notmuch-show.c
\r
128 +++ b/notmuch-show.c
\r
129 @@ -1166,6 +1166,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
133 + /* if format=mbox then we can not output excluded messages as
\r
134 + * there is no way to make the exclude flag available */
\r
136 + notmuch_query_set_omit_excluded_messages (query, TRUE);
\r
138 /* if part was requested and format was not specified, use format=raw */
\r
139 if (params.part >= 0 && !format_specified)
\r
140 format = &format_raw;
\r