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