Re: [PATCH v4 09/16] index encrypted parts when asked.
[notmuch-archives.git] / 5e / 35f72c029b8776ecf6a4de321061d1e96fc4ee
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 B245A431FB6\r
6         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 11:21:11 -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 E0P9oGSynAal for <notmuch@notmuchmail.org>;\r
16         Thu, 19 Jan 2012 11:21:11 -0800 (PST)\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
18         [74.125.82.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 2DB23431FBD\r
21         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 11:21:10 -0800 (PST)\r
22 Received: by mail-we0-f181.google.com with SMTP id p13so279138wer.26\r
23         for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 11:21:09 -0800 (PST)\r
24 Received: by 10.216.136.202 with SMTP id w52mr1097491wei.57.1327000869762;\r
25         Thu, 19 Jan 2012 11:21:09 -0800 (PST)\r
26 Received: from localhost ([109.131.97.13])\r
27         by mx.google.com with ESMTPS id dr5sm1085636wib.0.2012.01.19.11.21.09\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Thu, 19 Jan 2012 11:21:09 -0800 (PST)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Austin Clements <amdragon@MIT.EDU>\r
32 Subject: [PATCH 3/4] config: only set search.exclude_tags to "deleted; spam;\r
33         " during setup\r
34 Date: Thu, 19 Jan 2012 20:19:03 +0100\r
35 Message-Id: <1327000744-25463-4-git-send-email-pieter@praet.org>\r
36 X-Mailer: git-send-email 1.7.8.1\r
37 In-Reply-To: <1327000744-25463-1-git-send-email-pieter@praet.org>\r
38 References: <1326586654-16840-3-git-send-email-amdragon@mit.edu>\r
39         <1327000744-25463-1-git-send-email-pieter@praet.org>\r
40 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Thu, 19 Jan 2012 19:21:12 -0000\r
54 \r
55 If the 'search.exclude_tags' option is missing from the config file,\r
56 its value is automatically set to "deleted;spam;".  Taking PoLS/DWIM\r
57 into account, this should probably only happen during setup.\r
58 \r
59 This patch is actually Austin Clements' work:\r
60   id:"20120117203211.GQ16740@mit.edu"\r
61 \r
62 ---\r
63  notmuch-config.c |    8 ++++++--\r
64  test/search      |    1 -\r
65  2 files changed, 6 insertions(+), 3 deletions(-)\r
66 \r
67 diff --git a/notmuch-config.c b/notmuch-config.c\r
68 index 687bd76..1d9e842 100644\r
69 --- a/notmuch-config.c\r
70 +++ b/notmuch-config.c\r
71 @@ -361,8 +361,12 @@ notmuch_config_open (void *ctx,\r
72      }\r
73  \r
74      if (notmuch_config_get_search_exclude_tags (config, &tmp) == NULL) {\r
75 -       const char *tags[] = { "deleted", "spam" };\r
76 -       notmuch_config_set_search_exclude_tags (config, tags, 2);\r
77 +       if (is_new) {\r
78 +           const char *tags[] = { "deleted", "spam" };\r
79 +           notmuch_config_set_search_exclude_tags (config, tags, 2);\r
80 +       } else {\r
81 +           notmuch_config_set_search_exclude_tags (config, NULL, 0);\r
82 +       }\r
83      }\r
84  \r
85      error = NULL;\r
86 diff --git a/test/search b/test/search\r
87 index 99d94bd..414be35 100755\r
88 --- a/test/search\r
89 +++ b/test/search\r
90 @@ -149,7 +149,6 @@ test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; N\r
91  thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)"\r
92  \r
93  test_begin_subtest "Don't exclude \"deleted\" messages from search if not configured"\r
94 -test_subtest_known_broken\r
95  notmuch config set search.exclude_tags\r
96  output=$(notmuch search subject:deleted | notmuch_search_sanitize)\r
97  test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)\r
98 -- \r
99 1.7.8.1\r
100 \r