Re: [PATCH 3/5] nmbug-status: Add an nmbug-status(5) man page
[notmuch-archives.git] / 62 / 2ab0c7f40f148d60b4f47e1f4e87ad33a92a1e
1 Return-Path: <pieter@praet.org>\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 92F4642119F\r
6         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:24:52 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id ehWXUuoVmuKZ for <notmuch@notmuchmail.org>;\r
16         Sun, 22 Jan 2012 20:24:52 -0800 (PST)\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
18         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id EF5E742119C\r
21         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:24:51 -0800 (PST)\r
22 Received: by wibhi8 with SMTP id hi8so305684wib.26\r
23         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:24:50 -0800 (PST)\r
24 Received: by 10.180.83.72 with SMTP id o8mr11414755wiy.22.1327292690754;\r
25         Sun, 22 Jan 2012 20:24:50 -0800 (PST)\r
26 Received: from localhost ([109.131.95.182])\r
27         by mx.google.com with ESMTPS id eq5sm36881567wib.2.2012.01.22.20.24.50\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Sun, 22 Jan 2012 20:24:50 -0800 (PST)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Austin Clements <amdragon@mit.edu>\r
32 Subject: [PATCH v2 3/6] config: only exclude messages if 'search.exclude_tags'\r
33         is explicitly set\r
34 Date: Mon, 23 Jan 2012 05:22:34 +0100\r
35 Message-Id: <1327292557-7701-3-git-send-email-pieter@praet.org>\r
36 X-Mailer: git-send-email 1.7.8.1\r
37 In-Reply-To: <87obtvaw8h.fsf@praet.org>\r
38 References: <87obtvaw8h.fsf@praet.org>\r
39 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Mon, 23 Jan 2012 04:24:52 -0000\r
53 \r
54 Currently, the 'search.exclude_tags' option is automatically\r
55 set to "deleted;spam;" if it's missing from the config file.\r
56 \r
57 This violates the Principle of Least Surprise, so *only* set\r
58 'search.exclude_tags' to "deleted;spam;" if we didn't find a\r
59 configuration file at all.\r
60 \r
61 This patch is actually Austin Clements' work:\r
62   id:"20120117203211.GQ16740@mit.edu"\r
63 ---\r
64  notmuch-config.c |    8 ++++++--\r
65  test/search      |    1 -\r
66  2 files changed, 6 insertions(+), 3 deletions(-)\r
67 \r
68 diff --git a/notmuch-config.c b/notmuch-config.c\r
69 index 39da888..0ded6d7 100644\r
70 --- a/notmuch-config.c\r
71 +++ b/notmuch-config.c\r
72 @@ -362,8 +362,12 @@ notmuch_config_open (void *ctx,\r
73      }\r
74  \r
75      if (notmuch_config_get_search_exclude_tags (config, &tmp) == NULL) {\r
76 -       const char *tags[] = { "deleted", "spam" };\r
77 -       notmuch_config_set_search_exclude_tags (config, tags, 2);\r
78 +       if (is_new) {\r
79 +           const char *tags[] = { "deleted", "spam" };\r
80 +           notmuch_config_set_search_exclude_tags (config, tags, 2);\r
81 +       } else {\r
82 +           notmuch_config_set_search_exclude_tags (config, NULL, 0);\r
83 +       }\r
84      }\r
85  \r
86      error = NULL;\r
87 diff --git a/test/search b/test/search\r
88 index 99d94bd..414be35 100755\r
89 --- a/test/search\r
90 +++ b/test/search\r
91 @@ -149,7 +149,6 @@ test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; N\r
92  thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)"\r
93  \r
94  test_begin_subtest "Don't exclude \"deleted\" messages from search if not configured"\r
95 -test_subtest_known_broken\r
96  notmuch config set search.exclude_tags\r
97  output=$(notmuch search subject:deleted | notmuch_search_sanitize)\r
98  test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)\r
99 -- \r
100 1.7.8.1\r
101 \r