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 6861D431FBF
\r
6 for <notmuch@notmuchmail.org>; Sat, 7 Apr 2012 09:10:16 -0700 (PDT)
\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 A1viM1wKMB2W for <notmuch@notmuchmail.org>;
\r
18 Sat, 7 Apr 2012 09:10:15 -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 32C87431FBC
\r
23 for <notmuch@notmuchmail.org>; Sat, 7 Apr 2012 09:10:15 -0700 (PDT)
\r
24 Received: by mail-we0-f181.google.com with SMTP id m13so2289308wer.26
\r
25 for <notmuch@notmuchmail.org>; Sat, 07 Apr 2012 09:10:14 -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=evWbal5TZwC83T81p5PIhFxgGHmqMjVz7PLu6Fut7js=;
\r
29 b=U+25Ssu3CtfQ3zGdH4A6nQE6WgQRz9jl21RPj297uNSMD0i/dhnc63BQDs3PndYppJ
\r
30 eBIsjmLZczEtd6QQmqNwfsFgVGynAHWT3/3fqwroHCbp+mcZEmX0hNreKn4kqGW6hnuv
\r
31 EIyy7SMfEvEr8RgC73WL7L78UpGGnnNNQ2EftTetz1tNR+NFWUDM8QrP9U9lsR4+h7WF
\r
32 21ZAoL8zNuuvCNv88B8cEkXC1zgw8DqPLfk28sUrnlIX0P5WdK10AJoea4l8V54Yrx8E
\r
33 ZQEWx0zo862VyaMS1U333qi1cplRz9JkncVI8ojEfaMgVc7g/V8unkt48MoJC/kgPCvB
\r
35 Received: by 10.180.82.132 with SMTP id i4mr4086924wiy.12.1333815014833;
\r
36 Sat, 07 Apr 2012 09:10:14 -0700 (PDT)
\r
37 Received: from localhost (94.197.17.51.threembb.co.uk. [94.197.17.51])
\r
38 by mx.google.com with ESMTPS id
\r
39 bx13sm15630097wib.10.2012.04.07.09.10.12
\r
40 (version=TLSv1/SSLv3 cipher=OTHER);
\r
41 Sat, 07 Apr 2012 09:10:14 -0700 (PDT)
\r
42 From: Mark Walters <markwalters1009@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v4 1/6] lib: change default for
\r
45 notmuch_query_set_omit_excluded
\r
46 Date: Sat, 7 Apr 2012 17:10:03 +0100
\r
47 Message-Id: <1333815008-24668-2-git-send-email-markwalters1009@gmail.com>
\r
48 X-Mailer: git-send-email 1.7.9.1
\r
49 In-Reply-To: <1333815008-24668-1-git-send-email-markwalters1009@gmail.com>
\r
50 References: <1333815008-24668-1-git-send-email-markwalters1009@gmail.com>
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Sat, 07 Apr 2012 16:10:16 -0000
\r
66 lib/notmuch.h | 23 ++++++++++++++++++-----
\r
67 lib/query.cc | 10 +++++-----
\r
68 2 files changed, 23 insertions(+), 10 deletions(-)
\r
70 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
71 index babd208..673c423 100644
\r
74 @@ -449,12 +449,25 @@ typedef enum {
\r
76 notmuch_query_get_query_string (notmuch_query_t *query);
\r
78 -/* Specify whether to results should omit the excluded results rather
\r
79 - * than just marking them excluded. This is useful for passing a
\r
80 - * notmuch_messages_t not containing the excluded messages to other
\r
82 +/* Specify whether to omit excluded results or simply flag them. By
\r
83 + * default, this is set to TRUE.
\r
85 + * If this is TRUE, notmuch_query_search_messages will omit excluded
\r
86 + * messages from the results. notmuch_query_search_threads will omit
\r
87 + * threads that match only in excluded messages, but will include all
\r
88 + * messages in threads that match in at least one non-excluded
\r
91 + * The performance difference when calling
\r
92 + * notmuch_query_search_messages should be relatively small (and both
\r
93 + * should be very fast). However, in some cases,
\r
94 + * notmuch_query_search_threads is very much faster when omitting
\r
95 + * excluded messages as it does not need to construct the threads that
\r
96 + * only match in excluded messages.
\r
100 -notmuch_query_set_omit_excluded_messages (notmuch_query_t *query, notmuch_bool_t omit);
\r
101 +notmuch_query_set_omit_excluded (notmuch_query_t *query, notmuch_bool_t omit_excluded);
\r
103 /* Specify the sorting desired for this query. */
\r
105 diff --git a/lib/query.cc b/lib/query.cc
\r
106 index 68ac1e4..e9c1a2d 100644
\r
109 @@ -28,7 +28,7 @@ struct _notmuch_query {
\r
110 const char *query_string;
\r
111 notmuch_sort_t sort;
\r
112 notmuch_string_list_t *exclude_terms;
\r
113 - notmuch_bool_t omit_excluded_messages;
\r
114 + notmuch_bool_t omit_excluded;
\r
117 typedef struct _notmuch_mset_messages {
\r
118 @@ -92,7 +92,7 @@ notmuch_query_create (notmuch_database_t *notmuch,
\r
120 query->exclude_terms = _notmuch_string_list_create (query);
\r
122 - query->omit_excluded_messages = FALSE;
\r
123 + query->omit_excluded = TRUE;
\r
127 @@ -104,9 +104,9 @@ notmuch_query_get_query_string (notmuch_query_t *query)
\r
131 -notmuch_query_set_omit_excluded_messages (notmuch_query_t *query, notmuch_bool_t omit)
\r
132 +notmuch_query_set_omit_excluded (notmuch_query_t *query, notmuch_bool_t omit_excluded)
\r
134 - query->omit_excluded_messages = omit;
\r
135 + query->omit_excluded = omit_excluded;
\r
139 @@ -220,7 +220,7 @@ notmuch_query_search_messages (notmuch_query_t *query)
\r
140 if (query->exclude_terms) {
\r
141 exclude_query = _notmuch_exclude_tags (query, final_query);
\r
143 - if (query->omit_excluded_messages)
\r
144 + if (query->omit_excluded)
\r
145 final_query = Xapian::Query (Xapian::Query::OP_AND_NOT,
\r
146 final_query, exclude_query);
\r