--- /dev/null
+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 E8FE5431FBC\r
+ for <notmuch@notmuchmail.org>; Mon, 29 Oct 2012 17:57:04 -0700 (PDT)\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 e92pv-mW90u4 for <notmuch@notmuchmail.org>;\r
+ Mon, 29 Oct 2012 17:57:04 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
+ [18.7.68.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 52518431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 29 Oct 2012 17:57:04 -0700 (PDT)\r
+X-AuditID: 12074422-b7f746d0000008cc-be-508f25dffbfc\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+ by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id ED.08.02252.FD52F805; Mon, 29 Oct 2012 20:57:03 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q9U0v20K005649; \r
+ Mon, 29 Oct 2012 20:57:03 -0400\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 q9U0v0Hl022083\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Mon, 29 Oct 2012 20:57:01 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1TT08a-00020w-KW; Mon, 29 Oct 2012 20:57:00 -0400\r
+Date: Mon, 29 Oct 2012 20:57:00 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: James Vasile <james@hackervisions.org>\r
+Subject: Re: [PATCH] don't show x-foo tags in search view\r
+Message-ID: <20121030005700.GE15377@mit.edu>\r
+References: <87fw4x3y3e.fsf@hackervisions.org>\r
+ <87liepw0b4.fsf@convex-new.cs.unb.ca>\r
+ <87625tc6xd.fsf@hackervisions.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <87625tc6xd.fsf@hackervisions.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFupileLIzCtJLcpLzFFi42IRYrdT172v2h9gsPutvsWN1m5Gi//N1RbX\r
+ b85kdmD2mNT1jMnj2apbzB5bDr1nDmCO4rJJSc3JLEst0rdL4MrombScqaBHuuL7gXmMDYxb\r
+ hLoYOTgkBEwkTv3L7GLkBDLFJC7cW8/WxcjFISSwj1HiWu8GVghnA6PEqvtnWEGqhAROMklc\r
+ meAEkVjCKHH3USMbSIJFQFVi9aUuFhCbTUBDYtv+5YwgtoiAlsTK8/PAbGaBOIm2ztssIJuF\r
+ BSwlej7Fg4R5BXQk2s4sZYGYXy1x/8JFNoi4oMTJmU9YIFq1JG78e8kE0sosIC2x/B8HSJhT\r
+ QF/i5e5jYOWiAioSU05uY5vAKDQLSfcsJN2zELoXMDKvYpRNya3SzU3MzClOTdYtTk7My0st\r
+ 0jXVy80s0UtNKd3ECA5yF6UdjD8PKh1iFOBgVOLh3bCmL0CINbGsuDL3EKMkB5OSKG+bcn+A\r
+ EF9SfkplRmJxRnxRaU5q8SFGCQ5mJRHenzeBynlTEiurUovyYVLSHCxK4rzXUm76CwmkJ5ak\r
+ ZqemFqQWwWRlODiUJHg3qwANFSxKTU+tSMvMKUFIM3FwggznARp+DqSGt7ggMbc4Mx0if4pR\r
+ UUqctwLkIgGQREZpHlwvLAm9YhQHekWYdw9IOw8wgcF1vwIazAQ0WIevF2RwSSJCSqqBsUPl\r
+ f7WX5myNb6zOjrec9becnR2jrzSz/MVZ4/UGUVWt+6/vfnfq1vObBaW3l5SZ6M//uGtl6udn\r
+ arPEjYov6J+0V57UuOiYw6TANSwX+Zb/41qXsTuL68iK5ut8V5LCNCfN3vdlgky5p5HP4YfH\r
+ ww38z+xW2Zx3ftlNsaOnFC7/vnfT95Qi2wolluKMREMt5qLiRAB+nZ8vHQMAAA==\r
+Cc: notmuch mailing list <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: Tue, 30 Oct 2012 00:57:05 -0000\r
+\r
+I like it.\r
+\r
+Quoth James Vasile on Oct 29 at 5:19 pm:\r
+> This patch hides any tags in search view that match the regex specified\r
+> in `notmuch-search-hide-tag-regex`. That variable can be set via setq\r
+> or the customize interface. To hide all tags that begin with "x-" or\r
+> "X-", set `notmuch-search-hide-tag-regex` to "^X-".\r
+> \r
+> ---\r
+> emacs/notmuch.el | 16 +++++++++++++++-\r
+> 1 file changed, 15 insertions(+), 1 deletion(-)\r
+> \r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index f9454d8..4bff538 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -775,6 +775,14 @@ non-authors is found, assume that all of the authors match."\r
+> (overlay-put overlay 'isearch-open-invisible #'delete-overlay)))\r
+> (insert padding))))\r
+> \r
+> +(defcustom notmuch-search-hide-tag-regex ""\r
+> + "Regex specifying tags to hide in search view.\r
+\r
+I have no idea why, but Emacs typically uses "regexp" instead of\r
+"regex".\r
+\r
+> +\r
+> +Leave blank to disable hiding of tags in search view.\r
+\r
+Saying "Leave blank" supposes that the user knows what the default\r
+value is. How about "An empty string disables hiding of tags in\r
+search view."?\r
+\r
+Even better, though, would be to use nil to indicate this, since "" is\r
+a perfectly valid regexp and matches everything. In that case, this\r
+should say something like "If nil, no tags will be hidden in search\r
+view."\r
+\r
+> +Note: elisp regexes are case-insensitive"\r
+\r
+Likewise, "regexps". Also, Elisp regexps are not, in general,\r
+case-insensitive. If we want to control this, we should bind\r
+case-fold-search to nil around the string-match below and say\r
+something here like "Matching is case-insensitive."\r
+\r
+> + :type 'string\r
+\r
+Better would be 'regexp. Or, '(choice (const :tag "None" nil) regexp)\r
+to allow nil or a regexp.\r
+\r
+> + :group 'notmuch-search)\r
+> +\r
+> (defun notmuch-search-insert-field (field format-string result)\r
+> (cond\r
+> ((string-equal field "date")\r
+> @@ -793,7 +801,13 @@ non-authors is found, assume that all of the authors match."\r
+> (notmuch-search-insert-authors format-string (plist-get result :authors)))\r
+> \r
+> ((string-equal field "tags")\r
+> - (let ((tags-str (mapconcat 'identity (plist-get result :tags) " ")))\r
+> + (let ((tags-str (mapconcat 'identity\r
+> + (delq nil\r
+> + (mapcar (lambda (x) (if (and (not (equal notmuch-search-hide-tag-regex ""))\r
+> + (string-match notmuch-search-hide-tag-regex x))\r
+> + nil\r
+> + x)) (plist-get result :tags)))\r
+> + " ")))\r
+\r
+It would be simpler and more robust to use remove-if here. What about\r
+something like\r
+\r
+ (let ((tags-str\r
+ (mapconcat 'identity\r
+ (if notmuch-search-hide-tag-regex\r
+ (let ((case-fold-search t))\r
+ (remove-if\r
+ (apply-partially #'string-match\r
+ notmuch-search-hide-tag-regex)\r
+ (plist-get result :tags)))\r
+ (plist-get result :tags))\r
+ " ")))\r
+\r
+?\r
+\r
+> (insert (propertize (format format-string tags-str)\r
+> 'face 'notmuch-tag-face))))))\r
+> \r