Re: [PATCH] Automatically exclude tags in notmuch-show
authorAustin Clements <amdragon@MIT.EDU>
Thu, 19 Jan 2012 22:59:10 +0000 (17:59 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:45 +0000 (09:42 -0800)
0a/b7367bf58ac87a5219e8a91b10eab90ac7906c [new file with mode: 0644]

diff --git a/0a/b7367bf58ac87a5219e8a91b10eab90ac7906c b/0a/b7367bf58ac87a5219e8a91b10eab90ac7906c
new file mode 100644 (file)
index 0000000..aa6a3dc
--- /dev/null
@@ -0,0 +1,126 @@
+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 E410B431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 14:59:29 -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 0JFMskQZueQX for <notmuch@notmuchmail.org>;\r
+       Thu, 19 Jan 2012 14:59:29 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
+       [18.9.25.12])\r
+       by olra.theworths.org (Postfix) with ESMTP id 4BA94431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 14:59:29 -0800 (PST)\r
+X-AuditID: 1209190c-b7fad6d000000920-d7-4f18a050a176\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+       by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id D9.05.02336.050A81F4; Thu, 19 Jan 2012 17:59:29 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0JMxSwt030607; \r
+       Thu, 19 Jan 2012 17:59:28 -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 q0JMxR1x020507\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 19 Jan 2012 17:59:28 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1Ro0wo-0004N4-1c; Thu, 19 Jan 2012 17:59:10 -0500\r
+Date: Thu, 19 Jan 2012 17:59:10 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH] Automatically exclude tags in notmuch-show\r
+Message-ID: <20120119225910.GT16740@mit.edu>\r
+References: <874nvric7c.fsf@qmul.ac.uk>\r
+       <1327010583-23954-1-git-send-email-markwalters1009@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1327010583-23954-1-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IRYrdT0Q1cIOFv8NbZYvVcHovrN2cyOzB5\r
+       7Jx1l93j2apbzAFMUVw2Kak5mWWpRfp2CVwZC5b+Yy9o4q/4/8mzgfEGdxcjJ4eEgInEo9ZX\r
+       jBC2mMSFe+vZuhi5OIQE9jFKTD0zA8rZwCixdGc3lHOSSeLsuvmMEM4SRolZ72cxg/SzCKhK\r
+       tD1fwwpiswloSGzbvxxsroiAjsTtQwvYQWxmAWmJb7+bmUBsYQF7iclLF4P18gLV3DnRydLF\r
+       yAE0NF3i9ANniLCgxMmZT1ggWrUkbvx7yQRSAjJm+T8OkDCngJfEmtYpYFtFBVQkppzcxjaB\r
+       UWgWku5ZSLpnIXQvYGRexSibklulm5uYmVOcmqxbnJyYl5dapGuol5tZopeaUrqJERTQnJI8\r
+       OxjfHFQ6xCjAwajEw8vlKuEvxJpYVlyZe4hRkoNJSZR303ygEF9SfkplRmJxRnxRaU5q8SFG\r
+       CQ5mJRHehj6gHG9KYmVValE+TEqag0VJnFdF650f0LuJJanZqakFqUUwWRkODiUJXieQoYJF\r
+       qempFWmZOSUIaSYOTpDhPEDD14DU8BYXJOYWZ6ZD5E8x6nJ8+d12nlGIJS8/L1VKnLcXpEgA\r
+       pCijNA9uDiwRvWIUB3pLmHc1SBUPMInBTXoFtIQJaIlHkxjIkpJEhJRUAyNfcda0yoodBi/Z\r
+       wr78uFYnO9F9W8SfU29j/5RPPLZM7n61QG216Dzb2Ztm/Lb+FfnlU/x/5cXp90MbEuVXGa+r\r
+       ruo01xJ1uqvwec32H193JO0vjRZ8d/bGDUvFYm+dcy7LvBuijLeapc2f9/R/k0OIcOP5PUZH\r
+       vQqdQsOvVGyS9NyzyophdY0SS3FGoqEWc1FxIgCB5IqFHwMAAA==\r
+Cc: 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: Thu, 19 Jan 2012 22:59:30 -0000\r
+\r
+LGTM, but should definitely come with a test.\r
+\r
+Also, this won't commute with Pieter's patch\r
+(id:"1327000744-25463-2-git-send-email-pieter@praet.org"), so one or\r
+the other will have to get updated.\r
+\r
+Quoth Mark Walters on Jan 19 at 10:03 pm:\r
+> Add the use of auto_exclude_tags in notmuch-show.c.  As with Austin's\r
+> patch (commit 42a907992823030f070fc395a174f779998ca6f5) it just adds\r
+> the excluded tags to the query so the excluded messages will still\r
+> appear in the emacs interface, but as a single header line rather than\r
+> as a matching message.\r
+> ---\r
+>  notmuch-show.c |    8 ++++++++\r
+>  1 files changed, 8 insertions(+), 0 deletions(-)\r
+> \r
+> diff --git a/notmuch-show.c b/notmuch-show.c\r
+> index d14dac9..925dfd6 100644\r
+> --- a/notmuch-show.c\r
+> +++ b/notmuch-show.c\r
+> @@ -948,9 +948,12 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
+>      char *opt;\r
+>      const notmuch_show_format_t *format = &format_text;\r
+>      notmuch_show_params_t params;\r
+> +    const char **auto_exclude_tags;\r
+> +    size_t auto_exclude_tags_length;\r
+>      int mbox = 0;\r
+>      int format_specified = 0;\r
+>      int i;\r
+> +    unsigned int j;\r
+\r
+Hah.  The original patch series updated 'count' to use the new\r
+argument parsing solely so I could steal 'i' for the tag exclude code.\r
+\r
+>  \r
+>      params.entire_thread = 0;\r
+>      params.raw = 0;\r
+> @@ -1040,6 +1043,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
+>      return 1;\r
+>      }\r
+>  \r
+> +    auto_exclude_tags = notmuch_config_get_auto_exclude_tags\r
+> +        (config, &auto_exclude_tags_length);\r
+> +    for (j = 0; j < auto_exclude_tags_length; j++)\r
+> +        notmuch_query_add_tag_exclude (query, auto_exclude_tags[j]);\r
+> +\r
+>      /* if part was requested and format was not specified, use format=raw */\r
+>      if (params.part >= 0 && !format_specified)\r
+>      format = &format_raw;\r