[PATCH 5/5] Test: Add tests for "notmuch new" command line tags
[notmuch-archives.git] / a3 / 84097e36a1368010aed6d8a509952185ba6765
1 Return-Path: <amdragon@mit.edu>\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 16DE6429E54\r
6         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:35:06 -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 prRedKb+PTPe for <notmuch@notmuchmail.org>;\r
16         Sun, 22 Jan 2012 20:35:05 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
18         [18.7.68.35])\r
19         by olra.theworths.org (Postfix) with ESMTP id 8E2D9429E40\r
20         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:35:05 -0800 (PST)\r
21 X-AuditID: 12074423-b7f9c6d0000008c3-98-4f1ce379d373\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
23         by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 96.CD.02243.973EC1F4; Sun, 22 Jan 2012 23:35:05 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q0N4Z4ep029157; \r
27         Sun, 22 Jan 2012 23:35:04 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0N4Z2dm023568\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Sun, 22 Jan 2012 23:35:03 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1RpBc3-0002LU-5f; Sun, 22 Jan 2012 23:34:35 -0500\r
37 Date: Sun, 22 Jan 2012 23:34:35 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Pieter Praet <pieter@praet.org>\r
40 Subject: Re: [PATCH v2 5/6] setup: prompt user for search.exclude_tags value\r
41 Message-ID: <20120123043435.GR16740@mit.edu>\r
42 References: <87obtvaw8h.fsf@praet.org>\r
43         <1327292557-7701-5-git-send-email-pieter@praet.org>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To: <1327292557-7701-5-git-send-email-pieter@praet.org>\r
48 User-Agent: Mutt/1.5.21 (2010-09-15)\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hTV1q18LONvcOkBl8X1mzOZLX6/vsHs\r
51         wOTxbNUtZo+OfZdZA5iiuGxSUnMyy1KL9O0SuDIeP3EqaOWpaN32kKmBcRZnFyMnh4SAiUTb\r
52         7bssELaYxIV769m6GLk4hAT2MUq0nVnFBOFsYJTo37qXBcI5ySQx5+9fVghnCaPE16ldzCD9\r
53         LAKqEot+vmUCsdkENCS27V/OCGKLCChLnH7ykx3EZhbQkti68QNYXFjAR+L4nL9sIDavgI7E\r
54         xiv3weYICcRIvD65ixEiLihxcuYTFpjeG/9eAs3nALKlJZb/4wAJcwo4SJzbvxKsXFRARWLK\r
55         yW1sExiFZiHpnoWkexZC9wJG5lWMsim5Vbq5iZk5xanJusXJiXl5qUW6Znq5mSV6qSmlmxhB\r
56         Yc3uoryD8c9BpUOMAhyMSjy8kUtl/IVYE8uKK3MPMUpyMCmJ8q69CxTiS8pPqcxILM6ILyrN\r
57         SS0+xCjBwawkwuv8WdpfiDclsbIqtSgfJiXNwaIkzquh9c5PSCA9sSQ1OzW1ILUIJivDwaEk\r
58         wXvrEdBQwaLU9NSKtMycEoQ0EwcnyHAeoOGMwDQgxFtckJhbnJkOkT/FqCglzvsMpFkAJJFR\r
59         mgfXC0s7rxjFgV4R5mUAaecBpiy47ldAg5mABnPkSYEMLklESEk1MK49Zes06fYquXyLPWlB\r
60         zqqXq+uVH2xNN1nQ+m9VtyN33q7GcP8EpwA2punX1nQyeFy89/j3nYQf3xv3/l0zb66naOiT\r
61         9tCzUzZx/bap3tZufvFDnNK7tTbyXRsOq7x/JRLoJdxqIPkvfpfldae7FSx6IW3eNa8e1Sk5\r
62         cp2MFXx9fPkZ3jtV7kosxRmJhlrMRcWJABOcAGMWAwAA\r
63 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Mon, 23 Jan 2012 04:35:06 -0000\r
77 \r
78 Quoth Pieter Praet on Jan 23 at  5:22 am:\r
79 > Allow users to customize the search.exclude_tags option during setup.\r
80 > ---\r
81 >  notmuch-setup.c |   21 +++++++++++++++++++++\r
82 >  1 files changed, 21 insertions(+), 0 deletions(-)\r
83\r
84 > diff --git a/notmuch-setup.c b/notmuch-setup.c\r
85 > index dcfa607..0d75adc 100644\r
86 > --- a/notmuch-setup.c\r
87 > +++ b/notmuch-setup.c\r
88 > @@ -133,6 +133,8 @@ notmuch_setup_command (unused (void *ctx),\r
89 >      int is_new;\r
90 >      const char **new_tags;\r
91 >      size_t new_tags_len;\r
92 > +    const char **search_exclude_tags;\r
93 > +    size_t search_exclude_tags_len;\r
94 >  \r
95 >  #define prompt(format, ...)                                  \\r
96 >      do {                                                     \\r
97 > @@ -208,6 +210,25 @@ notmuch_setup_command (unused (void *ctx),\r
98 >       g_ptr_array_free (tags, TRUE);\r
99 >      }\r
100 >  \r
101 > +\r
102 > +    search_exclude_tags = notmuch_config_get_search_exclude_tags (config, &search_exclude_tags_len);\r
103 > +\r
104 > +    printf ("Tags to exclude when searching messages (separated by spaces) [");\r
105 > +    print_tag_list(search_exclude_tags, search_exclude_tags_len);\r
106 \r
107 Missing space before paren.\r
108 \r
109 > +    prompt ("]: ");\r
110 > +\r
111 > +    if (strlen (response)) {\r
112 > +     GPtrArray *tags = parse_tag_list (ctx, response);\r
113 > +\r
114 > +     notmuch_config_set_search_exclude_tags (config,\r
115 > +                                             (const char **)\r
116 > +                                             tags->pdata,\r
117 \r
118 No newline is needed between the case and the value.\r
119 \r
120 > +                                             tags->len);\r
121 > +\r
122 > +     g_ptr_array_free (tags, TRUE);\r
123 > +    }\r
124 > +\r
125 > +\r
126 >      if (! notmuch_config_save (config)) {\r
127 >       if (is_new)\r
128 >         welcome_message_post_setup ();\r