Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 2c / 59ab791d7842d9e8401e89008a04214ce80a1b
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 81F45429E43\r
6         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 10:39:30 -0800 (PST)\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 6Nor93+8B2Nc for <notmuch@notmuchmail.org>;\r
18         Sun, 29 Jan 2012 10:39:29 -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 97ACC429E3F\r
23         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 10:39:29 -0800 (PST)\r
24 Received: by mail-wi0-f181.google.com with SMTP id hi8so2994807wib.26\r
25         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 10:39:29 -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=uughHLUXJgckjirIO48Yw/vn1iM6lHSYqUPlbZNrG6Y=;\r
29         b=xPSRPW1Ut5/jZb8X1uITUR/elqOu6TgWe2nQ7y9P7Q8kXCNoqRm8cMajGOI4vG83iv\r
30         gKrzywu9Mu9lwqL9o3zjiav3bojmbpM/EEim1IldlaQlj9owA1QjdoEskgnVCKBjLLQf\r
31         y4+k6R0+M7wb+TCvCcBWm9etxkVACkpvfBcoI=\r
32 Received: by 10.180.89.71 with SMTP id bm7mr18753053wib.20.1327862369324;\r
33         Sun, 29 Jan 2012 10:39:29 -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  fv6sm44584373wib.8.2012.01.29.10.39.27 (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Sun, 29 Jan 2012 10:39:28 -0800 (PST)\r
38 From: Mark Walters <markwalters1009@gmail.com>\r
39 To: notmuch@notmuchmail.org,\r
40         amdragon@MIT.EDU\r
41 Subject: [PATCH 6/7] cli: omit excluded messages in results where appropriate.\r
42 Date: Sun, 29 Jan 2012 18:39:53 +0000\r
43 Message-Id: <1327862394-14334-6-git-send-email-markwalters1009@gmail.com>\r
44 X-Mailer: git-send-email 1.7.2.3\r
45 In-Reply-To: <8762fu4aqt.fsf@qmul.ac.uk>\r
46 References: <8762fu4aqt.fsf@qmul.ac.uk>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\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 18:39:30 -0000\r
60 \r
61 In all cases of notmuch count/search/show where the results returned\r
62 cannot reflect the exclude flag return just the matched not-excluded\r
63 results. If the caller wishes to have all the matched results (i.e.,\r
64 including the excluded ones) they should call with the\r
65 --do-not-exclude option.\r
66 \r
67 The relevant cases are\r
68     count: both threads and messages\r
69     search: all cases except the summary view\r
70     show: mbox format\r
71 ---\r
72  notmuch-count.c  |    2 ++\r
73  notmuch-search.c |    9 +++++++++\r
74  notmuch-show.c   |    5 +++++\r
75  3 files changed, 16 insertions(+), 0 deletions(-)\r
76 \r
77 diff --git a/notmuch-count.c b/notmuch-count.c\r
78 index c88975e..1aa3f1a 100644\r
79 --- a/notmuch-count.c\r
80 +++ b/notmuch-count.c\r
81 @@ -87,6 +87,8 @@ notmuch_count_command (void *ctx, int argc, char *argv[])\r
82             notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);\r
83      }\r
84  \r
85 +    notmuch_query_set_omit_excluded_messages (query, TRUE);\r
86 +\r
87      switch (output) {\r
88      case OUTPUT_MESSAGES:\r
89         printf ("%u\n", notmuch_query_count_messages (query));\r
90 diff --git a/notmuch-search.c b/notmuch-search.c\r
91 index 084dd05..339ce82 100644\r
92 --- a/notmuch-search.c\r
93 +++ b/notmuch-search.c\r
94 @@ -207,6 +207,9 @@ do_search_threads (const search_format_t *format,\r
95      int first_thread = 1;\r
96      int i;\r
97  \r
98 +    if (output == OUTPUT_THREADS)\r
99 +       notmuch_query_set_omit_excluded_messages (query, TRUE);\r
100 +\r
101      if (offset < 0) {\r
102         offset += notmuch_query_count_threads (query);\r
103         if (offset < 0)\r
104 @@ -297,6 +300,8 @@ do_search_messages (const search_format_t *format,\r
105      int first_message = 1;\r
106      int i;\r
107  \r
108 +    notmuch_query_set_omit_excluded_messages (query, TRUE);\r
109 +\r
110      if (offset < 0) {\r
111         offset += notmuch_query_count_messages (query);\r
112         if (offset < 0)\r
113 @@ -368,6 +373,10 @@ do_search_tags (notmuch_database_t *notmuch,\r
114      const char *tag;\r
115      int first_tag = 1;\r
116  \r
117 +    notmuch_query_set_omit_excluded_messages (query, TRUE);\r
118 +    /* should the following only special case if no excluded terms\r
119 +     * specified? */\r
120 +\r
121      /* Special-case query of "*" for better performance. */\r
122      if (strcmp (notmuch_query_get_query_string (query), "*") == 0) {\r
123         tags = notmuch_database_get_all_tags (notmuch);\r
124 diff --git a/notmuch-show.c b/notmuch-show.c\r
125 index 681827f..5d98724 100644\r
126 --- a/notmuch-show.c\r
127 +++ b/notmuch-show.c\r
128 @@ -1167,6 +1167,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
129         return 1;\r
130      }\r
131  \r
132 +    /* if format=mbox then we can not output excluded messages as\r
133 +     * there is no way to make the exclude flag available */\r
134 +    if (mbox)\r
135 +       notmuch_query_set_omit_excluded_messages (query, TRUE);\r
136 +\r
137      /* if part was requested and format was not specified, use format=raw */\r
138      if (params.part >= 0 && !format_specified)\r
139         format = &format_raw;\r
140 -- \r
141 1.7.2.3\r
142 \r