--- /dev/null
+Return-Path: <damien.cassou@gmail.com>\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 D29B2431FBD\r
+ for <notmuch@notmuchmail.org>; Fri, 18 Jan 2013 08:04:13 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_FROM=0.001, 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 gfIKWmw5BCIc for <notmuch@notmuchmail.org>;\r
+ Fri, 18 Jan 2013 08:04:13 -0800 (PST)\r
+Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com\r
+ [209.85.212.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 1C355431FBF\r
+ for <notmuch@notmuchmail.org>; Fri, 18 Jan 2013 08:04:12 -0800 (PST)\r
+Received: by mail-wi0-f177.google.com with SMTP id hm2so3161599wib.16\r
+ for <notmuch@notmuchmail.org>; Fri, 18 Jan 2013 08:04:12 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=x-received:from:to:subject:date:message-id:x-mailer;\r
+ bh=oD39k+oHPwLuX7NeBGvunHXOQ7KRBsL2ELeoOt87vXA=;\r
+ b=05ljllL8qjSzEAsJvd0Sy94MErhRllw/qpAjPCJamxMrCCjRZkE+sbQHxlYnfCKJwO\r
+ WIbv4RYQBpW1emHHKrddptiDVQJEbbKfDzKxDKfffY/MFhr2xl+G2T5x93oqlOB9VU3r\r
+ Nm6fZEYb3g982+FYHjraBeYEGLyBZeWgm4gnrW1GghrEj4lUP397hwlJlwo3ri28Iq8x\r
+ k5hYJLrg+VPyN4i+C+QOE5JJqSi+uWWHv5XJSOXlyfgXzyb1um8rjFcEkhPjO4uFSzU5\r
+ ZR/ErrWY4cwWuFOq+EkeNqmFT8AgkXx/oDs1lwbUlkCP9SVPGO7uuZjz37ZSkE5UrNyp\r
+ D0Fg==\r
+X-Received: by 10.194.143.35 with SMTP id sb3mr15063156wjb.30.1358525051726;\r
+ Fri, 18 Jan 2013 08:04:11 -0800 (PST)\r
+Received: from luz3.lille.inria.fr ([193.51.236.44])\r
+ by mx.google.com with ESMTPS id i2sm4073866wiw.3.2013.01.18.08.04.10\r
+ (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);\r
+ Fri, 18 Jan 2013 08:04:10 -0800 (PST)\r
+From: Damien Cassou <damien.cassou@gmail.com>\r
+To: notmuch mailing list <notmuch@notmuchmail.org>\r
+Subject: emacs: Customize how each tag is displayed\r
+Date: Fri, 18 Jan 2013 17:03:54 +0100\r
+Message-Id: <1358525039-13569-1-git-send-email-damien.cassou@gmail.com>\r
+X-Mailer: git-send-email 1.7.10.4\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: Fri, 18 Jan 2013 16:04:14 -0000\r
+\r
+[PATCH 1/4] emacs: Add notmuch-intersperse to notmuch-lib/\r
+[PATCH 2/4] emacs: pictures that might be used as icons for tags\r
+[PATCH 3/4] emacs: possibility to customize the rendering of tags\r
+[PATCH 4/4] emacs: provide convenience functions for notmuch-tagger\r
+\r
+\r
+These patches are the first of an upcoming series whose goal is to\r
+integrate notmuch-labeler into notmuch. See the following for more\r
+details: https://github.com/DamienCassou/notmuch-labeler\r
+\r
+Points of discussion:\r
+\r
+- This series does not have any unit-test to make it smaller and more\r
+ amenable to comments. I will send a patch when requested.\r
+\r
+- Patch 3/4 formats tags as mode-line templates so that we can show\r
+ tags in the header-line in a later series.\r
+\r
+- Patch 3/4 introduces `notmuch-tagger-formats', a list of pairs (KEY\r
+ FORMAT) to format a tag matching KEY using a special format.\r
+ Currently, an example of such a list is:\r
+\r
+ (("unread"\r
+ (:propertize "unread" face\r
+ (:foreground "red")))\r
+ ("flagged"\r
+ (:propertize "flagged" display\r
+ (image :type svg\r
+ :file ,(notmuch-tagger-image-path "star.svg")\r
+ :ascent center :mask heuristic))))\r
+\r
+ to set the unread tag to be red and the flagged tag to have a star\r
+ picture attached. Because this variable is hard to edit without\r
+ making mistakes, patch 4/4 introduces customization functions that\r
+ the user can call on their init.el file like this:\r
+\r
+ (notmuch-tagger-propertize "unread" :foreground "red")\r
+ (notmuch-tagger-image-star "flagged")\r
+\r
+ Nevertheless, implementing a customize interface for this variable\r
+ is difficult as Emacs does not provide customization widgets for\r
+ text-property lists. A possible solution could be to change the list\r
+ value so that it looks like:\r
+\r
+ (("unread" (propertize :foreground "red"))\r
+ ("flagged" (image-star)))\r
+\r
+ where the FORMAT part of each pair would be the suffix of a\r
+ notmuch-tagger customization function name (as introduced by patch\r
+ 4/4) and the rest would be parameters to pass to this function\r
+ (except the KEY parameter that is already in each pair of the\r
+ `notmuch-tagger-formats' list). This solution would be more amenable\r
+ to the customization interface, but maybe less powerful.\r