--- /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 B213C431FC7\r
+ for <notmuch@notmuchmail.org>; Mon, 19 Nov 2012 21:32:12 -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 AVBPvZ9CxFML for <notmuch@notmuchmail.org>;\r
+ Mon, 19 Nov 2012 21:32:11 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
+ [18.7.68.37])\r
+ by olra.theworths.org (Postfix) with ESMTP id D407C431FBC\r
+ for <notmuch@notmuchmail.org>; Mon, 19 Nov 2012 21:32:10 -0800 (PST)\r
+X-AuditID: 12074425-b7fcc6d00000091f-04-50ab15d9b496\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+ by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 2B.17.02335.9D51BA05; Tue, 20 Nov 2012 00:32:09 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id qAK5W9np007400; \r
+ Tue, 20 Nov 2012 00:32:09 -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 qAK5W7hg001257\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Tue, 20 Nov 2012 00:32:08 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@MIT.EDU>)\r
+ id 1TagRL-0000Kd-34; Tue, 20 Nov 2012 00:32:07 -0500\r
+Date: Tue, 20 Nov 2012 00:32:07 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Damien Cassou <damien.cassou@gmail.com>\r
+Subject: Re: [PATCH 1/4] Add a thread's tags to emacs header-line\r
+Message-ID: <20121120053207.GB32514@mit.edu>\r
+References: <1353266322-20318-1-git-send-email-damien.cassou@gmail.com>\r
+ <1353266322-20318-2-git-send-email-damien.cassou@gmail.com>\r
+ <20121120051320.GA32514@mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=iso-8859-1\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\r
+In-Reply-To: <20121120051320.GA32514@mit.edu>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFlrBKsWRmVeSWpSXmKPExsUixCmqrHtTdHWAwe9uG4tdd7cyWVy/OZPZ\r
+ gclj56y77B7PVt1iDmCK4rJJSc3JLEst0rdL4Mp4vX8+W8E3lYqDtx6wNTA+keli5OSQEDCR\r
+ 2PfuPiuELSZx4d56ti5GLg4hgX2MEtuetTJDOBsYJZ6f/coI4Zxkkth/pIMdpEVIYAmjxPwl\r
+ XCA2i4CqxNVXt5lBbDYBDYlt+5czgtgiAtoSb5Z2gK1gFjCSuL9jOliNsICjROuUlWA2r4CO\r
+ xLqdp6BWr2CU+LHuAVRCUOLkzCcsEM06Eju33gEq4gCypSWW/+OACMtLNG+dDVbOKaArcfLd\r
+ aTYQW1RARWLKyW1sExiFZyGZNAvJpFkIk2YhmbSAkWUVo2xKbpVubmJmTnFqsm5xcmJeXmqR\r
+ roVebmaJXmpK6SZGUCSwu6juYJxwSOkQowAHoxIP74OEVQFCrIllxZW5hxglOZiURHk3CK8O\r
+ EOJLyk+pzEgszogvKs1JLT7EKMHBrCTC21QOVM6bklhZlVqUD5OS5mBREue9kXLTX0ggPbEk\r
+ NTs1tSC1CCYrw8GhJMHrJQI0VLAoNT21Ii0zpwQhzcTBCTKcB2i4P0gNb3FBYm5xZjpE/hSj\r
+ LsfCNe1PGIVY8vLzUqXEeXNAigRAijJK8+DmwBLYK0ZxoLeEeatAqniAyQ9u0iugJUxAS64F\r
+ LAdZUpKIkJJqYAw1fVQ/c1frZfPVW9uvvX+w6f8sGydPY73Di35qzF7nHMYZesY6qu3/nxuP\r
+ zsik/wt3M1qz6iT/o3iPqI4ZzVeffyvrL/tl6FwdtXDhj46Flpu2bZe/bmrQG/RKsMPkj+fa\r
+ bdeK3zFODhFdWKEy/ZKbjlrhAaVkK9GdN//m9qz1edByzoTLMECJpTgj0VCLuag4EQDN79UG\r
+ OwMAAA==\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, 20 Nov 2012 05:32:12 -0000\r
+\r
+Sorry, I was a little trigger-happy on the send. A few more comments\r
+below.\r
+\r
+Quoth myself on Nov 20 at 12:13 am:\r
+> Quoth Damien Cassou on Nov 18 at 8:18 pm:\r
+> > Signed-off-by: Damien Cassou <damien.cassou@gmail.com>\r
+> > ---\r
+> > emacs/notmuch-show.el | 24 +++++++++++++++++++++---\r
+> > emacs/notmuch-tagger.el | 44 ++++++++++++++++++++++++++++++++++++++++++++\r
+> > 2 files changed, 65 insertions(+), 3 deletions(-)\r
+> > create mode 100644 emacs/notmuch-tagger.el\r
+> > \r
+> > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> > index 5b3e70e..988e27c 100644\r
+> > --- a/emacs/notmuch-show.el\r
+> > +++ b/emacs/notmuch-show.el\r
+> > @@ -36,6 +36,7 @@\r
+> > (require 'notmuch-mua)\r
+> > (require 'notmuch-crypto)\r
+> > (require 'notmuch-print)\r
+> > +(require 'notmuch-tagger)\r
+> > \r
+> > (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))\r
+> > (declare-function notmuch-fontify-headers "notmuch" nil)\r
+> > @@ -1121,11 +1122,28 @@ function is used."\r
+> > \r
+> > (jit-lock-register #'notmuch-show-buttonise-links)\r
+> > \r
+> > - ;; Set the header line to the subject of the first message.\r
+> > - (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))\r
+> > -\r
+> > + (notmuch-show-update-header-line)\r
+> > (run-hooks 'notmuch-show-hook))))\r
+> > \r
+> > +(defun notmuch-show-thread-tags ()\r
+> > + "Return the list of tags for the current thread."\r
+> > + (let ((tags (list)))\r
+> > + (notmuch-show-mapc (lambda ()\r
+> > + (mapcar (lambda (elt)\r
+> > + ;; Avoid adding duplicate tags\r
+> > + (add-to-list 'tags elt))\r
+> > + (notmuch-show-get-tags))))\r
+> > + tags))\r
+> > +\r
+> > +(defun notmuch-show-update-header-line ()\r
+> > + "Make the header-line show the thread's subject and tags."\r
+> > + (let ((thread-subject (notmuch-show-strip-re (notmuch-show-get-subject))))\r
+> > + (setq header-line-format\r
+> > + (list\r
+> > + thread-subject\r
+> > + " "\r
+> > + (notmuch-tagger-present-tags-header-line (notmuch-show-thread-tags))))))\r
+> > +\r
+> > (defun notmuch-show-capture-state ()\r
+> > "Capture the state of the current buffer.\r
+> > \r
+> > diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el\r
+> > new file mode 100644\r
+> > index 0000000..5ca190e\r
+> > --- /dev/null\r
+> > +++ b/emacs/notmuch-tagger.el\r
+> > @@ -0,0 +1,44 @@\r
+> > +;; notmuch-tagger.el --- Library to improve the way tags are displayed\r
+> > +;;\r
+> > +;; Copyright © Damien Cassou\r
+> > +;;\r
+> > +;; This file is part of Notmuch.\r
+> > +;;\r
+> > +;; Notmuch is free software: you can redistribute it and/or modify it\r
+> > +;; under the terms of the GNU General Public License as published by\r
+> > +;; the Free Software Foundation, either version 3 of the License, or\r
+> > +;; (at your option) any later version.\r
+> > +;;\r
+> > +;; Notmuch is distributed in the hope that it will be useful, but\r
+> > +;; WITHOUT ANY WARRANTY; without even the implied warranty of\r
+> > +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+> > +;; General Public License for more details.\r
+> > +;;\r
+> > +;; You should have received a copy of the GNU General Public License\r
+> > +;; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.\r
+> > +;;\r
+> > +;; Authors: Damien Cassou <damien.cassou@gmail.com>\r
+> > +;;; Commentary:\r
+> > +;;\r
+> > +;;; Code:\r
+> > +;;\r
+> > +(defun notmuch-tagger-separate-elems (list sep)\r
+> \r
+> notmuch-tagger-intersperse?\r
+> \r
+> This could also reasonably go in notmuch-lib.el as a general utility.\r
+> \r
+> (How do neither Elisp nor 'cl have an intersperse?)\r
+> \r
+> > + "Return a list with all elements of LIST separated by SEP."\r
+> > + (let ((first t)\r
+> > + (res nil))\r
+> > + (dolist (elt (reverse list) res)\r
+> \r
+> (dolist (elt list (nreverse res)) ...) to save a list copy?\r
+> \r
+> > + (unless first\r
+> > + (push sep res))\r
+> > + (setq first nil)\r
+> > + (push elt res))))\r
+> > +\r
+> > +(defun notmuch-tagger-present-tags-header-line (tags)\r
+\r
+notmuch-tagger-format-tags-header-line? It doesn't actually present\r
+them (though "format" isn't great either.)\r
+\r
+> > + "Return a property list to present TAGS in emacs header-line."\r
+\r
+This doesn't return a property list, it returns a mode-line-format\r
+template. Maybe something like,\r
+\r
+ "Format TAGS as a mode-line-format template.\r
+The result is suitable for inclusion in `header-line-format' or\r
+`mode-line-format'."\r
+\r
+(Is it actually suitable for mode-line-format or do header-line\r
+buttons really only work in the header line?)\r
+\r
+> > + (list\r
+> > + "("\r
+> > + (notmuch-tagger-separate-elems tags " ")\r
+> > + ")"))\r
+> > +\r
+> > +\r
+> > +(provide 'notmuch-tagger)\r
+> > +;;; notmuch-tagger.el ends here\r