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 0C0F4431FB6
\r
6 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 16:03:40 -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 kfls08WHxdDn for <notmuch@notmuchmail.org>;
\r
18 Sat, 28 Jan 2012 16:03:38 -0800 (PST)
\r
19 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com
\r
20 [209.85.212.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 8096D431FCF
\r
23 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 16:03:38 -0800 (PST)
\r
24 Received: by wibhi8 with SMTP id hi8so2596577wib.26
\r
25 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 16:03:34 -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=krUCqqz0X2fnmr20vCWL+6+gJcYb2WFd5dLJsgUEqtg=;
\r
29 b=D4OfPNlEsI9IazHYFVbOkAKxhIyFCkNbMMVtK7sVkHKehmFleaUNA0TeJzhNzfeUVM
\r
30 9VFxbq+60moUWQFM+4aHpCOu3c/JtxFkBfF0REbOKWrJ8zUkfZ9AEum/IFyNHSCuWFBS
\r
31 FSpzi5o9RU4znRpK7WzoYgF/BQnq+h66Ua9jY=
\r
32 Received: by 10.180.94.97 with SMTP id db1mr19295174wib.16.1327795414708;
\r
33 Sat, 28 Jan 2012 16:03:34 -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 dr5sm37507743wib.0.2012.01.28.16.03.33 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Sat, 28 Jan 2012 16:03:33 -0800 (PST)
\r
38 From: Mark Walters <markwalters1009@gmail.com>
\r
39 To: notmuch@notmuchmail.org,
\r
41 Subject: [PATCH 4/4] Add exclude flag
\r
42 Date: Sun, 29 Jan 2012 00:04:04 +0000
\r
43 Message-Id: <1327795444-18745-4-git-send-email-markwalters1009@gmail.com>
\r
44 X-Mailer: git-send-email 1.7.2.3
\r
45 In-Reply-To: <8739azqt2j.fsf@qmul.ac.uk>
\r
46 References: <8739azqt2j.fsf@qmul.ac.uk>
\r
47 X-BeenThere: notmuch@notmuchmail.org
\r
48 X-Mailman-Version: 2.1.13
\r
50 List-Id: "Use and development of the notmuch mail system."
\r
51 <notmuch.notmuchmail.org>
\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
55 List-Post: <mailto:notmuch@notmuchmail.org>
\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
59 X-List-Received-Date: Sun, 29 Jan 2012 00:03:40 -0000
\r
61 Make notmuch-show.c respect the EXCLUDE flag.
\r
64 notmuch-show.c | 20 +++++++++++++++++---
\r
65 1 files changed, 17 insertions(+), 3 deletions(-)
\r
67 diff --git a/notmuch-show.c b/notmuch-show.c
\r
68 index dec799c..b55d2ba 100644
\r
69 --- a/notmuch-show.c
\r
70 +++ b/notmuch-show.c
\r
71 @@ -193,10 +193,12 @@ _get_one_line_summary (const void *ctx, notmuch_message_t *message)
\r
73 format_message_text (unused (const void *ctx), notmuch_message_t *message, int indent)
\r
75 - printf ("id:%s depth:%d match:%d filename:%s\n",
\r
76 + /* Could changing this could break users ? */
\r
77 + printf ("id:%s depth:%d match:%d excluded:%d filename:%s\n",
\r
78 notmuch_message_get_message_id (message),
\r
80 notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH),
\r
81 + notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_EXCLUDED),
\r
82 notmuch_message_get_filename (message));
\r
85 @@ -212,9 +214,10 @@ format_message_json (const void *ctx, notmuch_message_t *message, unused (int in
\r
86 date = notmuch_message_get_date (message);
\r
87 relative_date = notmuch_time_relative_date (ctx, date);
\r
89 - printf ("\"id\": %s, \"match\": %s, \"filename\": %s, \"timestamp\": %ld, \"date_relative\": \"%s\", \"tags\": [",
\r
90 + printf ("\"id\": %s, \"match\": %s, \"excluded\": %s, \"filename\": %s, \"timestamp\": %ld, \"date_relative\": \"%s\", \"tags\": [",
\r
91 json_quote_str (ctx_quote, notmuch_message_get_message_id (message)),
\r
92 notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH) ? "true" : "false",
\r
93 + notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_EXCLUDED) ? "true" : "false",
\r
94 json_quote_str (ctx_quote, notmuch_message_get_filename (message)),
\r
95 date, relative_date);
\r
97 @@ -293,6 +296,7 @@ _is_from_line (const char *line)
\r
99 * http://qmail.org/qmail-manual-html/man5/mbox.html
\r
101 +/* should this do something with the exclude flag? */
\r
103 format_message_mbox (const void *ctx,
\r
104 notmuch_message_t *message,
\r
105 @@ -947,9 +951,11 @@ do_show_single (void *ctx,
\r
106 notmuch_messages_t *messages;
\r
107 notmuch_message_t *message;
\r
109 + /* we need to fix something in notmuch_query_count for now just
\r
110 + * comment this out*/
\r
111 if (notmuch_query_count_messages (query) != 1) {
\r
112 fprintf (stderr, "Error: search term did not match precisely one message.\n");
\r
117 messages = notmuch_query_search_messages (query);
\r
118 @@ -1059,9 +1065,12 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
120 const notmuch_show_format_t *format = &format_text;
\r
121 notmuch_show_params_t params;
\r
122 + const char **search_exclude_tags;
\r
123 + size_t search_exclude_tags_length;
\r
125 int format_specified = 0;
\r
129 params.entire_thread = 0;
\r
131 @@ -1158,6 +1167,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
135 + search_exclude_tags = notmuch_config_get_search_exclude_tags
\r
136 + (config, &search_exclude_tags_length);
\r
137 + for (j = 0; j < search_exclude_tags_length; j++)
\r
138 + notmuch_query_add_tag_exclude (query, search_exclude_tags[j]);
\r
140 /* if part was requested and format was not specified, use format=raw */
\r
141 if (params.part >= 0 && !format_specified)
\r
142 format = &format_raw;
\r