Re: [PATCH v2 5/6] setup: prompt user for search.exclude_tags value
authorAustin Clements <amdragon@MIT.EDU>
Mon, 23 Jan 2012 04:34:35 +0000 (23:34 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:58 +0000 (09:42 -0800)
a3/84097e36a1368010aed6d8a509952185ba6765 [new file with mode: 0644]

diff --git a/a3/84097e36a1368010aed6d8a509952185ba6765 b/a3/84097e36a1368010aed6d8a509952185ba6765
new file mode 100644 (file)
index 0000000..59d9cee
--- /dev/null
@@ -0,0 +1,128 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 16DE6429E54\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:35:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id prRedKb+PTPe for <notmuch@notmuchmail.org>;\r
+       Sun, 22 Jan 2012 20:35:05 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
+       [18.7.68.35])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8E2D9429E40\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 20:35:05 -0800 (PST)\r
+X-AuditID: 12074423-b7f9c6d0000008c3-98-4f1ce379d373\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 96.CD.02243.973EC1F4; Sun, 22 Jan 2012 23:35:05 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q0N4Z4ep029157; \r
+       Sun, 22 Jan 2012 23:35:04 -0500\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0N4Z2dm023568\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sun, 22 Jan 2012 23:35:03 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1RpBc3-0002LU-5f; Sun, 22 Jan 2012 23:34:35 -0500\r
+Date: Sun, 22 Jan 2012 23:34:35 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Pieter Praet <pieter@praet.org>\r
+Subject: Re: [PATCH v2 5/6] setup: prompt user for search.exclude_tags value\r
+Message-ID: <20120123043435.GR16740@mit.edu>\r
+References: <87obtvaw8h.fsf@praet.org>\r
+       <1327292557-7701-5-git-send-email-pieter@praet.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1327292557-7701-5-git-send-email-pieter@praet.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hTV1q18LONvcOkBl8X1mzOZLX6/vsHs\r
+       wOTxbNUtZo+OfZdZA5iiuGxSUnMyy1KL9O0SuDIeP3EqaOWpaN32kKmBcRZnFyMnh4SAiUTb\r
+       7bssELaYxIV769m6GLk4hAT2MUq0nVnFBOFsYJTo37qXBcI5ySQx5+9fVghnCaPE16ldzCD9\r
+       LAKqEot+vmUCsdkENCS27V/OCGKLCChLnH7ykx3EZhbQkti68QNYXFjAR+L4nL9sIDavgI7E\r
+       xiv3weYICcRIvD65ixEiLihxcuYTFpjeG/9eAs3nALKlJZb/4wAJcwo4SJzbvxKsXFRARWLK\r
+       yW1sExiFZiHpnoWkexZC9wJG5lWMsim5Vbq5iZk5xanJusXJiXl5qUW6Znq5mSV6qSmlmxhB\r
+       Yc3uoryD8c9BpUOMAhyMSjy8kUtl/IVYE8uKK3MPMUpyMCmJ8q69CxTiS8pPqcxILM6ILyrN\r
+       SS0+xCjBwawkwuv8WdpfiDclsbIqtSgfJiXNwaIkzquh9c5PSCA9sSQ1OzW1ILUIJivDwaEk\r
+       wXvrEdBQwaLU9NSKtMycEoQ0EwcnyHAeoOGMwDQgxFtckJhbnJkOkT/FqCglzvsMpFkAJJFR\r
+       mgfXC0s7rxjFgV4R5mUAaecBpiy47ldAg5mABnPkSYEMLklESEk1MK49Zes06fYquXyLPWlB\r
+       zqqXq+uVH2xNN1nQ+m9VtyN33q7GcP8EpwA2punX1nQyeFy89/j3nYQf3xv3/l0zb66naOiT\r
+       9tCzUzZx/bap3tZufvFDnNK7tTbyXRsOq7x/JRLoJdxqIPkvfpfldae7FSx6IW3eNa8e1Sk5\r
+       cp2MFXx9fPkZ3jtV7kosxRmJhlrMRcWJABOcAGMWAwAA\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 23 Jan 2012 04:35:06 -0000\r
+\r
+Quoth Pieter Praet on Jan 23 at  5:22 am:\r
+> Allow users to customize the search.exclude_tags option during setup.\r
+> ---\r
+>  notmuch-setup.c |   21 +++++++++++++++++++++\r
+>  1 files changed, 21 insertions(+), 0 deletions(-)\r
+> \r
+> diff --git a/notmuch-setup.c b/notmuch-setup.c\r
+> index dcfa607..0d75adc 100644\r
+> --- a/notmuch-setup.c\r
+> +++ b/notmuch-setup.c\r
+> @@ -133,6 +133,8 @@ notmuch_setup_command (unused (void *ctx),\r
+>      int is_new;\r
+>      const char **new_tags;\r
+>      size_t new_tags_len;\r
+> +    const char **search_exclude_tags;\r
+> +    size_t search_exclude_tags_len;\r
+>  \r
+>  #define prompt(format, ...)                                 \\r
+>      do {                                                    \\r
+> @@ -208,6 +210,25 @@ notmuch_setup_command (unused (void *ctx),\r
+>      g_ptr_array_free (tags, TRUE);\r
+>      }\r
+>  \r
+> +\r
+> +    search_exclude_tags = notmuch_config_get_search_exclude_tags (config, &search_exclude_tags_len);\r
+> +\r
+> +    printf ("Tags to exclude when searching messages (separated by spaces) [");\r
+> +    print_tag_list(search_exclude_tags, search_exclude_tags_len);\r
+\r
+Missing space before paren.\r
+\r
+> +    prompt ("]: ");\r
+> +\r
+> +    if (strlen (response)) {\r
+> +    GPtrArray *tags = parse_tag_list (ctx, response);\r
+> +\r
+> +    notmuch_config_set_search_exclude_tags (config,\r
+> +                                            (const char **)\r
+> +                                            tags->pdata,\r
+\r
+No newline is needed between the case and the value.\r
+\r
+> +                                            tags->len);\r
+> +\r
+> +    g_ptr_array_free (tags, TRUE);\r
+> +    }\r
+> +\r
+> +\r
+>      if (! notmuch_config_save (config)) {\r
+>      if (is_new)\r
+>        welcome_message_post_setup ();\r