1 Return-Path: <novalazy@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 B2022431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 13 May 2013 07:20:36 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id 87EKU+b+X4vn for <notmuch@notmuchmail.org>;
\r
17 Mon, 13 May 2013 07:20:31 -0700 (PDT)
\r
18 Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com
\r
19 [209.85.220.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 28A27431FAE
\r
22 for <notmuch@notmuchmail.org>; Mon, 13 May 2013 07:20:31 -0700 (PDT)
\r
23 Received: by mail-pa0-f50.google.com with SMTP id fb10so4616819pad.23
\r
24 for <notmuch@notmuchmail.org>; Mon, 13 May 2013 07:20:30 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to
\r
27 :references; bh=egNzpeoyPhsaR+IxbSLHUjrlVwa66ky0s5ooVduz6gI=;
\r
28 b=xiGF/bkiBNEOorkMPHD6zYreBz4fjyCge9KIFxT5mu0JssSZNuX5bdybIwY3RHUaeN
\r
29 rj8+5YsWiZ/wp/kOaRP+HldUJOsBVaOT01nt0PqYwJieM5xDPqg+5Aud8OykNVlM1yNc
\r
30 OJXs/aD2JHE0lLdUfhcQ0bUAIDRE9jmkI11pgInv4WUt4F0hakA+MHo6og2QNIq1eB4Y
\r
31 mVaHnbkkg3fEiyExbmH9mPZ4lID4gz1DP9TfI0jvBHsGhZgs36fDLuATAPnWYN5y8MjX
\r
32 7hOz4/bDgEG+L960clc1xIoOPPRagaQl9cVfl3gcN6KBg/4lS4r37juK6FgGYHljNJNl
\r
34 X-Received: by 10.66.218.170 with SMTP id ph10mr30529077pac.134.1368454830472;
\r
35 Mon, 13 May 2013 07:20:30 -0700 (PDT)
\r
36 Received: from localhost (215.42.233.220.static.exetel.com.au.
\r
38 by mx.google.com with ESMTPSA id 10sm14219628pbr.45.2013.05.13.07.20.27
\r
39 for <multiple recipients>
\r
40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
41 Mon, 13 May 2013 07:20:29 -0700 (PDT)
\r
42 From: Peter Wang <novalazy@gmail.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v2] cli: clarify correspondence of --exclude to omit_excluded
\r
46 Date: Tue, 14 May 2013 00:20:15 +1000
\r
47 Message-Id: <1368454815-1854-1-git-send-email-novalazy@gmail.com>
\r
48 X-Mailer: git-send-email 1.7.12.1
\r
49 In-Reply-To: <1368301809-12532-1-git-send-email-markwalters1009@gmail.com>
\r
50 References: <1368301809-12532-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: Mon, 13 May 2013 14:20:36 -0000
\r
65 Make it obvious how the --exclude command-line option affects the
\r
66 omit_excluded field in notmuch_query_t objects, with an explicit and
\r
67 exhaustive switch. Do not expect the reader to know the default value
\r
70 This can be inserted after patch 2.
\r
72 notmuch-search.c | 23 +++++++++++++++++++----
\r
73 1 file changed, 19 insertions(+), 4 deletions(-)
\r
75 diff --git a/notmuch-search.c b/notmuch-search.c
\r
76 index 4323201..893df10 100644
\r
77 --- a/notmuch-search.c
\r
78 +++ b/notmuch-search.c
\r
79 @@ -290,6 +290,24 @@ enum {
\r
84 +exclude_option_to_omit_excluded (int exclude)
\r
86 + switch (exclude) {
\r
87 + case EXCLUDE_TRUE:
\r
88 + return NOTMUCH_EXCLUDE_TRUE;
\r
89 + case EXCLUDE_FALSE:
\r
90 + return NOTMUCH_EXCLUDE_FALSE;
\r
91 + case EXCLUDE_FLAG:
\r
92 + return NOTMUCH_EXCLUDE_FALSE;
\r
94 + return NOTMUCH_EXCLUDE_ALL;
\r
96 + INTERNAL_ERROR ("unhandled exclude option %d", exclude);
\r
102 notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])
\r
104 @@ -410,11 +428,8 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])
\r
105 (config, &search_exclude_tags_length);
\r
106 for (i = 0; i < search_exclude_tags_length; i++)
\r
107 notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);
\r
108 - if (exclude == EXCLUDE_FLAG)
\r
109 - notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_FALSE);
\r
110 - if (exclude == EXCLUDE_ALL)
\r
111 - notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_ALL);
\r
113 + notmuch_query_set_omit_excluded (query, exclude_option_to_omit_excluded (exclude));
\r