From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B245A431FB6 for ; Thu, 19 Jan 2012 11:21:11 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E0P9oGSynAal for ; Thu, 19 Jan 2012 11:21:11 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2DB23431FBD for ; Thu, 19 Jan 2012 11:21:10 -0800 (PST) Received: by mail-we0-f181.google.com with SMTP id p13so279138wer.26 for ; Thu, 19 Jan 2012 11:21:09 -0800 (PST) Received: by 10.216.136.202 with SMTP id w52mr1097491wei.57.1327000869762; Thu, 19 Jan 2012 11:21:09 -0800 (PST) Received: from localhost ([109.131.97.13]) by mx.google.com with ESMTPS id dr5sm1085636wib.0.2012.01.19.11.21.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 11:21:09 -0800 (PST) From: Pieter Praet To: Austin Clements Subject: [PATCH 3/4] config: only set search.exclude_tags to "deleted; spam; " during setup Date: Thu, 19 Jan 2012 20:19:03 +0100 Message-Id: <1327000744-25463-4-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.8.1 In-Reply-To: <1327000744-25463-1-git-send-email-pieter@praet.org> References: <1326586654-16840-3-git-send-email-amdragon@mit.edu> <1327000744-25463-1-git-send-email-pieter@praet.org> Cc: Notmuch Mail X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 19:21:12 -0000 If the 'search.exclude_tags' option is missing from the config file, its value is automatically set to "deleted;spam;". Taking PoLS/DWIM into account, this should probably only happen during setup. This patch is actually Austin Clements' work: id:"20120117203211.GQ16740@mit.edu" --- notmuch-config.c | 8 ++++++-- test/search | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/notmuch-config.c b/notmuch-config.c index 687bd76..1d9e842 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -361,8 +361,12 @@ notmuch_config_open (void *ctx, } if (notmuch_config_get_search_exclude_tags (config, &tmp) == NULL) { - const char *tags[] = { "deleted", "spam" }; - notmuch_config_set_search_exclude_tags (config, tags, 2); + if (is_new) { + const char *tags[] = { "deleted", "spam" }; + notmuch_config_set_search_exclude_tags (config, tags, 2); + } else { + notmuch_config_set_search_exclude_tags (config, NULL, 0); + } } error = NULL; diff --git a/test/search b/test/search index 99d94bd..414be35 100755 --- a/test/search +++ b/test/search @@ -149,7 +149,6 @@ test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; N thread:XXX 2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)" test_begin_subtest "Don't exclude \"deleted\" messages from search if not configured" -test_subtest_known_broken notmuch config set search.exclude_tags output=$(notmuch search subject:deleted | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread) -- 1.7.8.1