Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / d9 / 84a0c1a79021837829054137c4ad357a00e51a
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 3495441ED88\r
6         for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 01:03:21 -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 Z9AV2aQQFUdO for <notmuch@notmuchmail.org>;\r
18         Wed, 15 Feb 2012 01:03:19 -0800 (PST)\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 C9FEC431E82\r
23         for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 01:03:18 -0800 (PST)\r
24 Received: by mail-we0-f181.google.com with SMTP id p13so603332wer.26\r
25         for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 01:03: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=W5gWFpKFDk0cYcvFsue3qkq4xkV12E+Ahl6I/T4aQRk=;\r
29         b=HmL5g3pKdziCFkbNMDO7r69bsXcWi0oz2r2CBfkTqyES5tAakJ/ie8f7szGK2xxtNU\r
30         ho05mbQbC7eXTEQpzUcVL/SgA9KIUIRWCXz8ricjhqRJpnMlnBxNloMdSD5OgslBL8MK\r
31         u9KCXtRvgDOPLxubxm/6t0lYgmGVw0OGkpgRk=\r
32 Received: by 10.180.82.39 with SMTP id f7mr33843586wiy.19.1329296598586;\r
33         Wed, 15 Feb 2012 01:03: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  s8sm32092059wiz.8.2012.02.15.01.03.17  (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Wed, 15 Feb 2012 01:03:17 -0800 (PST)\r
38 From: Mark Walters <markwalters1009@gmail.com>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [RFC PATCH v5 10/11] cli: omit excluded messages in results where\r
41         appropriate.\r
42 Date: Wed, 15 Feb 2012 09:03:38 +0000\r
43 Message-Id: <1329296619-7463-11-git-send-email-markwalters1009@gmail.com>\r
44 X-Mailer: git-send-email 1.7.2.3\r
45 In-Reply-To: <1329296619-7463-1-git-send-email-markwalters1009@gmail.com>\r
46 References: <1329296619-7463-1-git-send-email-markwalters1009@gmail.com>\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: Wed, 15 Feb 2012 09:03:21 -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 --no-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   |    6 ++++++\r
75  3 files changed, 17 insertions(+), 0 deletions(-)\r
76 \r
77 diff --git a/notmuch-count.c b/notmuch-count.c\r
78 index 5364507..46b76ae 100644\r
79 --- a/notmuch-count.c\r
80 +++ b/notmuch-count.c\r
81 @@ -88,6 +88,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 43ec90b..d2b2488 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 2a634e9..17a4ec6 100644\r
126 --- a/notmuch-show.c\r
127 +++ b/notmuch-show.c\r
128 @@ -1080,6 +1080,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
129             fprintf (stderr, "Error: specifying parts is incompatible with mbox output format.\n");\r
130             return 1;\r
131         }\r
132 +\r
133         format = &format_mbox;\r
134         break;\r
135      case NOTMUCH_FORMAT_RAW:\r
136 @@ -1137,6 +1138,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
137         return 1;\r
138      }\r
139  \r
140 +    /* if format=mbox then we can not output excluded messages as\r
141 +     * there is no way to make the exclude flag available */\r
142 +    if (format_sel == NOTMUCH_FORMAT_MBOX)\r
143 +       notmuch_query_set_omit_excluded_messages (query, TRUE);\r
144 +\r
145      /* If a single message is requested we do not use search_excludes. */\r
146      if (params.part >= 0)\r
147         ret = do_show_single (ctx, query, format, &params);\r
148 -- \r
149 1.7.2.3\r
150 \r