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 D7225429E54
\r
6 for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 21:42:39 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 ITfxABYhlTmh for <notmuch@notmuchmail.org>;
\r
16 Sun, 22 Jan 2012 21:42:39 -0800 (PST)
\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com
\r
18 [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 2A9E4429E40 for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 21:42:39 -0800
\r
22 Received: by wgbdt12 with SMTP id dt12so2245908wgb.2
\r
23 for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 21:42:38 -0800 (PST)
\r
24 Received: by 10.180.20.69 with SMTP id l5mr11704568wie.19.1327297357951;
\r
25 Sun, 22 Jan 2012 21:42:37 -0800 (PST)
\r
26 Received: from localhost ([109.131.95.182])
\r
27 by mx.google.com with ESMTPS id df2sm10985969wib.4.2012.01.22.21.42.37
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Sun, 22 Jan 2012 21:42:37 -0800 (PST)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: Austin Clements <amdragon@MIT.EDU>
\r
32 Subject: [PATCH v3 5/6] setup: prompt user for search.exclude_tags value
\r
33 Date: Mon, 23 Jan 2012 06:40:33 +0100
\r
34 Message-Id: <1327297233-9193-1-git-send-email-pieter@praet.org>
\r
35 X-Mailer: git-send-email 1.7.8.1
\r
36 In-Reply-To: <20120123043435.GR16740@mit.edu>
\r
37 References: <20120123043435.GR16740@mit.edu>
\r
38 Cc: Notmuch Mail <notmuch@notmuchmail.org>
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Mon, 23 Jan 2012 05:42:40 -0000
\r
53 Allow users to customize the search.exclude_tags option during setup.
\r
58 - less copy-paste coding... :)
\r
60 v3: Austin's corrections [1]
\r
61 - @ `print_tag_list':
\r
62 add space before paren.
\r
64 - @ `notmuch_config_set_search_exclude_tags':
\r
65 remove \n between type cast and value.
\r
67 [1] id:"20120123043435.GR16740@mit.edu"
\r
69 notmuch-setup.c | 20 ++++++++++++++++++++
\r
70 1 files changed, 20 insertions(+), 0 deletions(-)
\r
72 diff --git a/notmuch-setup.c b/notmuch-setup.c
\r
73 index dcfa607..2941c52 100644
\r
74 --- a/notmuch-setup.c
\r
75 +++ b/notmuch-setup.c
\r
76 @@ -133,6 +133,8 @@ notmuch_setup_command (unused (void *ctx),
\r
78 const char **new_tags;
\r
79 size_t new_tags_len;
\r
80 + const char **search_exclude_tags;
\r
81 + size_t search_exclude_tags_len;
\r
83 #define prompt(format, ...) \
\r
85 @@ -208,6 +210,24 @@ notmuch_setup_command (unused (void *ctx),
\r
86 g_ptr_array_free (tags, TRUE);
\r
90 + search_exclude_tags = notmuch_config_get_search_exclude_tags (config, &search_exclude_tags_len);
\r
92 + printf ("Tags to exclude when searching messages (separated by spaces) [");
\r
93 + print_tag_list (search_exclude_tags, search_exclude_tags_len);
\r
96 + if (strlen (response)) {
\r
97 + GPtrArray *tags = parse_tag_list (ctx, response);
\r
99 + notmuch_config_set_search_exclude_tags (config,
\r
100 + (const char **) tags->pdata,
\r
103 + g_ptr_array_free (tags, TRUE);
\r
107 if (! notmuch_config_save (config)) {
\r
109 welcome_message_post_setup ();
\r