Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D3676421198 for ; Sun, 22 Jan 2012 20:24:58 -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 4UvkTwfrQRnd for ; Sun, 22 Jan 2012 20:24:58 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 3839442119C for ; Sun, 22 Jan 2012 20:24:58 -0800 (PST) Received: by mail-ww0-f45.google.com with SMTP id dt12so2215149wgb.2 for ; Sun, 22 Jan 2012 20:24:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.96.161 with SMTP id dt1mr11194874wib.13.1327292697862; Sun, 22 Jan 2012 20:24:57 -0800 (PST) Received: from localhost ([109.131.95.182]) by mx.google.com with ESMTPS id ex2sm36898420wib.1.2012.01.22.20.24.57 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Jan 2012 20:24:57 -0800 (PST) From: Pieter Praet To: Austin Clements Subject: [PATCH v2 5/6] setup: prompt user for search.exclude_tags value Date: Mon, 23 Jan 2012 05:22:36 +0100 Message-Id: <1327292557-7701-5-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.8.1 In-Reply-To: <87obtvaw8h.fsf@praet.org> References: <87obtvaw8h.fsf@praet.org> X-Gm-Message-State: ALoCoQm3q+r4I6IDPmg6sM8ycVGrSKjPgVExGWdF/cAMfbysdK7kENFZOaRWYAjYsTxSrlDFnbBh 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: Mon, 23 Jan 2012 04:24:59 -0000 Allow users to customize the search.exclude_tags option during setup. --- notmuch-setup.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/notmuch-setup.c b/notmuch-setup.c index dcfa607..0d75adc 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@ -133,6 +133,8 @@ notmuch_setup_command (unused (void *ctx), int is_new; const char **new_tags; size_t new_tags_len; + const char **search_exclude_tags; + size_t search_exclude_tags_len; #define prompt(format, ...) \ do { \ @@ -208,6 +210,25 @@ notmuch_setup_command (unused (void *ctx), g_ptr_array_free (tags, TRUE); } + + search_exclude_tags = notmuch_config_get_search_exclude_tags (config, &search_exclude_tags_len); + + printf ("Tags to exclude when searching messages (separated by spaces) ["); + print_tag_list(search_exclude_tags, search_exclude_tags_len); + prompt ("]: "); + + if (strlen (response)) { + GPtrArray *tags = parse_tag_list (ctx, response); + + notmuch_config_set_search_exclude_tags (config, + (const char **) + tags->pdata, + tags->len); + + g_ptr_array_free (tags, TRUE); + } + + if (! notmuch_config_save (config)) { if (is_new) welcome_message_post_setup (); -- 1.7.8.1