--- /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 3955C431FBF\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 14:58:03 -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 m4uZDQQLNsLG for <notmuch@notmuchmail.org>;\r
+ Tue, 11 Feb 2014 14:57:59 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu\r
+ [18.7.68.37])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id AA7F0431FBD\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 14:57:58 -0800 (PST)\r
+X-AuditID: 12074425-f79906d000000cf9-2b-52faaaf41278\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+ (using TLS with cipher AES256-SHA (256/256 bits))\r
+ (Client did not present a certificate)\r
+ by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 1E.F3.03321.4FAAAF25; Tue, 11 Feb 2014 17:57:56 -0500 (EST)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s1BMvtkg014003; \r
+ Tue, 11 Feb 2014 17:57:56 -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.8/8.12.4) with ESMTP id s1BMvqjZ017960\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+ Tue, 11 Feb 2014 17:57:54 -0500\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1WDMH2-0002fY-C7; Tue, 11 Feb 2014 17:57:52 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/7] emacs: tag: allow default case in notmuch-tag-formats\r
+In-Reply-To: <87ob2e0wyp.fsf@qmul.ac.uk>\r
+References: <1390087855-26194-1-git-send-email-markwalters1009@gmail.com>\r
+ <1390087855-26194-3-git-send-email-markwalters1009@gmail.com>\r
+ <87txc6n84q.fsf@awakening.csail.mit.edu>\r
+ <87ob2e0wyp.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.17~rc2+14~g06f47e0 (http://notmuchmail.org) Emacs/23.4.1\r
+ (i486-pc-linux-gnu)\r
+Date: Tue, 11 Feb 2014 17:57:51 -0500\r
+Message-ID: <87r479mf4g.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsUixCmqrPtl1a8gg94j0har5/JYXL85k9mB\r
+ yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyni//SRTwW69ilW/9jI2ME5T7WLk5JAQMJGY\r
+ cWIhK4QtJnHh3no2EFtIYDaTxP7Ddl2MXED2RkaJcz/aWCASp5kkutYHQCSWMEr8WXiEHSTB\r
+ JqAhsW3/ckYQW0TAVeLpt8/MILawgJ/Ess0bgWo4ODiBas7vEYKYc4ZRYsd6HxBbVCBJ4vTU\r
+ 32BHsAioSryfcBJsDC/QcYe7t7NA2IISJ2c+AbOZBbQkbvx7yTSBUWAWktQsJKkFjEyrGGVT\r
+ cqt0cxMzc4pTk3WLkxPz8lKLdC30cjNL9FJTSjcxgoKR3UV1B+OEQ0qHGAU4GJV4eAUX/QoS\r
+ Yk0sK67MPcQoycGkJMrLBgxlIb6k/JTKjMTijPii0pzU4kOMEhzMSiK8QSuBcrwpiZVVqUX5\r
+ MClpDhYlcd5aC6CUQHpiSWp2ampBahFMVoaDQ0mCNwKkUbAoNT21Ii0zpwQhzcTBCTKcB2j4\r
+ EbDhxQWJucWZ6RD5U4yKUuK8zCAXCYAkMkrz4HphyeIVozjQK8K8r0DaeYCJBq77FdBgJqDB\r
+ /dlgg0sSEVJSDYxrnV2fz7rw725WgpXF7533LaYoeVlrLufrVZvN5H2rJCxmhfXhOwe3Hszb\r
+ ufz96a4SiXC/CVrxiu6R1q5vlBsmPXbUZ2dMqP/52Kv6l0T24ugJR94tbynqqQo+mhvD7qQz\r
+ /+SXG7WGiuqtnKYb/3AtmhsTH3jJRHzJXt0tai1vqppL+otfXVRiKc5INNRiLipOBADTYlrH\r
+ 8QIAAA==\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, 11 Feb 2014 22:58:03 -0000\r
+\r
+On Tue, 11 Feb 2014, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> Thanks for the review.\r
+>\r
+> On Mon, 10 Feb 2014, Austin Clements <amdragon@MIT.EDU> wrote:\r
+>> On Sat, 18 Jan 2014, Mark Walters <markwalters1009@gmail.com> wrote:\r
+>>> Allow an empty string in notmuch-tag-formats which matches all tags\r
+>>> except those matched explicitly matched. This allows the user to tell\r
+>>\r
+>> Typo.\r
+>\r
+> Will fix.\r
+>\r
+>>> notmuch to hide all tags except those specified.\r
+>>>\r
+>>> This will be useful once formatting for deleted/added tags is added\r
+>>> later in the series: a user might want to hide all deleted tags for\r
+>>> example.\r
+>>> ---\r
+>>> emacs/notmuch-tag.el | 20 +++++++++++---------\r
+>>> 1 files changed, 11 insertions(+), 9 deletions(-)\r
+>>>\r
+>>> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
+>>> index 2153068..92c1249 100644\r
+>>> --- a/emacs/notmuch-tag.el\r
+>>> +++ b/emacs/notmuch-tag.el\r
+>>> @@ -65,14 +65,15 @@\r
+>>> This gives a list that maps from tag names to lists of formatting\r
+>>> expressions. The car of each element gives a tag name and the\r
+>>> cdr gives a list of Elisp expressions that modify the tag. If\r
+>>> -the list is empty, the tag will simply be hidden. Otherwise,\r
+>>> -each expression will be evaluated in order: for the first\r
+>>> -expression, the variable `tag' will be bound to the tag name; for\r
+>>> -each later expression, the variable `tag' will be bound to the\r
+>>> -result of the previous expression. In this way, each expression\r
+>>> -can build on the formatting performed by the previous expression.\r
+>>> -The result of the last expression will displayed in place of the\r
+>>> -tag.\r
+>>> +the car is an empty string it matches all tags that do not have\r
+>>> +an explicit match. If the list is empty, the tag will simply be\r
+>>\r
+>> Hmm. I'm not sure I like overloading of the meanings of strings. Could\r
+>> we instead use a symbol to represent this case? For example, `t' would\r
+>> parallel the fall-through case of `cond' and `case', or `_' would\r
+>> parallel `pcase' [1]. Or even a separate variable like\r
+>> notmuch-tag-default-format?\r
+>\r
+> I would prefer not to have a separate variable as I want the default\r
+> case for added/deleted tags too (see next patch), so it would need to be\r
+> 3 separate variables. But maybe that makes things clearer and is worth\r
+> doing?\r
+\r
+Ah, I see. In that case I agree this shouldn't be a separate variable\r
+(that idea was just a workaround anyway).\r
+\r
+> One other possibility that would solve the customize problem would be to\r
+> allow regexps for the matches. The regexp would have to match the\r
+> complete tag and only the first match would be used. This has advantages\r
+> (the user can highlight all notmuch::.* tags or can hide all X-\r
+> tags). The downside is that finding/testing for a regexp match is about\r
+> 20 times slower than using assoc, primarily because assoc is written in\r
+> C and the regexp match bit in lisp.\r
+\r
+I really like the idea of using regexps for this. I wouldn't worry\r
+about the performance. We can almost certainly eliminate that problem\r
+with a sprinkle of caching (which would probably be even faster than\r
+assoc), and that can be added separately.\r
+\r
+>> The former would require some tweaking of the customize widget, but that\r
+>> should probably happen anyway to support this special case.\r
+>> Unfortunately, we may need a custom alist widget variant to do that. (I\r
+>> tried and failed to tweak it in a way that both worked and looked\r
+>> decent.) Hence my suggestion of a separate variable, which would only\r
+>> require pulling out the :value-type into its own define-widget.\r
+>\r
+> If we go this route I may need some help getting this to work: pulling\r
+> out value-type didn't work on my first attempt.\r
+>\r
+>> I'm also slightly bothered that this would introduce a second way to\r
+>> control the default formatting of tags in addition to notmuch-tag-face,\r
+>> but only slightly.\r
+>\r
+> Yes that slightly bothered me but I didn't see a solution.\r
+>\r
+>> [1] It's unfortunate that pcase wasn't introduced until Emacs 24. I've\r
+>> been tempted to backport it for notmuch multiple times now. Then we\r
+>> could just treat notmuch-tag-formats as a list of pcase conditions.\r
+>\r
+> Would that still involve a lisp loop so would be comparable to the\r
+> regexp bit above? I haven't looked at pcase enough to work out its\r
+> details.\r
+\r
+pcase compiles into a decision tree, which could in principle reduce\r
+this to a fast lookup when possible, though I don't know if the\r
+implementation is actually that smart. At any rate, I like the idea of\r
+using regexps for this better anyway.\r
+\r
+> Best wishes\r
+>\r
+> Mark\r
+>\r
+>\r
+>>\r
+>>> +hidden. Otherwise, each expression will be evaluated in order:\r
+>>> +for the first expression, the variable `tag' will be bound to the\r
+>>> +tag name; for each later expression, the variable `tag' will be\r
+>>> +bound to the result of the previous expression. In this way,\r
+>>> +each expression can build on the formatting performed by the\r
+>>> +previous expression. The result of the last expression will\r
+>>> +displayed in place of the tag.\r
+>>> \r
+>>> For example, to replace a tag with another string, simply use\r
+>>> that string as a formatting expression. To change the foreground\r
+>>> @@ -140,7 +141,8 @@ This can be used with `notmuch-tag-format-image-data'."\r
+>>> \r
+>>> (defun notmuch-tag-format-tag (tag)\r
+>>> "Format TAG by looking into `notmuch-tag-formats'."\r
+>>> - (let ((formats (assoc tag notmuch-tag-formats)))\r
+>>> + (let ((formats (or (assoc tag notmuch-tag-formats)\r
+>>> + (assoc "" notmuch-tag-formats))))\r
+>>> (cond\r
+>>> ((null formats) ;; - Tag not in `notmuch-tag-formats',\r
+>>> tag) ;; the format is the tag itself.\r
+>>> -- \r
+>>> 1.7.9.1\r
+>>>\r
+>>> _______________________________________________\r
+>>> notmuch mailing list\r
+>>> notmuch@notmuchmail.org\r
+>>> http://notmuchmail.org/mailman/listinfo/notmuch\r