--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\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 6CB8E431FBD\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 02:23:38 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 RNAuNtJXu0d6 for <notmuch@notmuchmail.org>;\r
+ Tue, 11 Feb 2014 02:23:34 -0800 (PST)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\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 478B8431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 02:23:34 -0800 (PST)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1WDAUx-0000MF-8V; Tue, 11 Feb 2014 10:23:29 +0000\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1WDAUw-0000h2-Tc; Tue, 11 Feb 2014 10:23:27 +0000\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/7] emacs: tag: allow default case in notmuch-tag-formats\r
+In-Reply-To: <87txc6n84q.fsf@awakening.csail.mit.edu>\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
+User-Agent: Notmuch/0.15.2+484~gfb59956 (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 11 Feb 2014 10:23:26 +0000\r
+Message-ID: <87ob2e0wyp.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-Geographic: According to ripencc,\r
+ this message was delivered by a machine in Britain (UK) (GB).\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 1e2bcd0138791253cfbc41f74200bbb3 (of first 20000 bytes)\r
+X-SpamAssassin-Score: 0.0\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored 0.0 points. Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * 0.0 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\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 10:23:38 -0000\r
+\r
+\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
+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
+> 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
+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