1 Return-Path: <damien.cassou@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 6E9E3431FBD
\r
6 for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 11:19:20 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id NTRMLS0beBec for <notmuch@notmuchmail.org>;
\r
17 Sun, 18 Nov 2012 11:19:18 -0800 (PST)
\r
18 Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com
\r
19 [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
20 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
21 9B5D0431FD9 for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 11:19:18 -0800
\r
23 Received: by mail-wg0-f41.google.com with SMTP id ds1so859565wgb.2
\r
24 for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 11:19:17 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
27 bh=uqTLr+lChGZ4OFtNm21p+SL8DSP28mvvERQVw8E32HU=;
\r
28 b=WMp3V1fCEsAk9orVq8X3uvtQExwBemvAxv0BH8feaHjU27PK5//RiwwfpAS9zs5xzD
\r
29 2C6gQkqCI2l6OEoXZve3IVYxMqKcJhxZOzNcSiZNjx/aMuyEriRVWKuHiAv8MN0IGcVA
\r
30 N9tzeqJU5A5S105C38ijpRC319eUOq3CcRK4FhwbOMcMFeJh/J6IMD9utICkNOzQkjlW
\r
31 Jux1AJmQxEtKVxgIAPv+PbEDPBs1iVFr9iQQyFUSal3SkxAVSetjVa5EBADAQKieYoqm
\r
32 T/gsnAFgtx8E0KkHhebTrPlo5EJsvfU9tskhRANI8O5crF9lNRGI6U5Fe7u5nQ2Gen4C
\r
34 Received: by 10.216.196.202 with SMTP id r52mr2513540wen.81.1353266357332;
\r
35 Sun, 18 Nov 2012 11:19:17 -0800 (PST)
\r
36 Received: from localhost.localdomain (ble59-4-82-228-190-150.fbx.proxad.net.
\r
38 by mx.google.com with ESMTPS id i2sm10290063wiw.3.2012.11.18.11.19.16
\r
39 (version=TLSv1/SSLv3 cipher=OTHER);
\r
40 Sun, 18 Nov 2012 11:19:16 -0800 (PST)
\r
41 From: Damien Cassou <damien.cassou@gmail.com>
\r
42 To: notmuch mailing list <notmuch@notmuchmail.org>
\r
43 Subject: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable
\r
44 Date: Sun, 18 Nov 2012 20:18:41 +0100
\r
45 Message-Id: <1353266322-20318-4-git-send-email-damien.cassou@gmail.com>
\r
46 X-Mailer: git-send-email 1.7.10.4
\r
47 In-Reply-To: <1353266322-20318-1-git-send-email-damien.cassou@gmail.com>
\r
48 References: <1353266322-20318-1-git-send-email-damien.cassou@gmail.com>
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.13
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Sun, 18 Nov 2012 19:19:20 -0000
\r
63 Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
\r
65 emacs/notmuch-show.el | 9 +++++----
\r
66 emacs/notmuch-tagger.el | 33 +++++++++++++++++++++++++++++++++
\r
67 2 files changed, 38 insertions(+), 4 deletions(-)
\r
69 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
70 index 988e27c..379c8cd 100644
\r
71 --- a/emacs/notmuch-show.el
\r
72 +++ b/emacs/notmuch-show.el
\r
73 @@ -431,10 +431,11 @@ message at DEPTH in the current thread."
\r
74 (notmuch-show-clean-address (plist-get headers :From))
\r
78 - (propertize (mapconcat 'identity tags " ")
\r
79 - 'face 'notmuch-tag-face)
\r
83 + (format-mode-line (notmuch-tagger-present-tags tags))
\r
84 + 'face 'notmuch-tag-face)
\r
86 (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
\r
88 (defun notmuch-show-insert-header (header header-value)
\r
89 diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el
\r
90 index 19a6c7e..379a905 100644
\r
91 --- a/emacs/notmuch-tagger.el
\r
92 +++ b/emacs/notmuch-tagger.el
\r
93 @@ -53,12 +53,21 @@ test if the library is present before calling this function."
\r
94 (let ((tag (header-button-get button 'notmuch-tagger-tag)))
\r
95 (notmuch-tagger-goto-target tag)))
\r
97 +(defun notmuch-tagger-body-button-action (button)
\r
98 + "Open `notmuch-search' for the tag referenced by BUTTON."
\r
99 + (let ((tag (button-get button 'notmuch-tagger-tag)))
\r
100 + (notmuch-tagger-goto-target tag)))
\r
102 (eval-after-load "header-button"
\r
103 '(define-button-type 'notmuch-tagger-header-button-type
\r
105 'action #'notmuch-tagger-header-button-action
\r
108 +(define-button-type 'notmuch-tagger-body-button-type
\r
109 + 'action #'notmuch-tagger-body-button-action
\r
112 (defun notmuch-tagger-really-make-header-link (tag)
\r
113 "Return a property list that presents a link to TAG.
\r
115 @@ -82,6 +91,19 @@ if not."
\r
116 (notmuch-tagger-really-make-header-link tag)
\r
119 +(defun notmuch-tagger-make-body-link (tag)
\r
120 + "Return a property list that presents a link to TAG.
\r
121 +The returned property list will work everywhere except in the
\r
122 +header-line. For a link that works on the header-line, prefer
\r
123 +`notmuch-tagger-make-header-link'."
\r
124 + (let ((button (copy-sequence tag)))
\r
125 + (make-text-button
\r
127 + 'type 'notmuch-tagger-body-button-type
\r
128 + 'notmuch-tagger-tag tag
\r
129 + 'help-echo (format "%s: Search other messages like this" tag))
\r
132 (defun notmuch-tagger-present-tags-header-line (tags)
\r
133 "Return a property list to present TAGS in emacs header-line."
\r
135 @@ -91,6 +113,17 @@ if not."
\r
139 +(defun notmuch-tagger-present-tags (tags)
\r
140 + "Return a property list to present TAGS in emacs.
\r
141 +If tags the result of this function is to be used within the
\r
142 +header-line, prefer `notmuch-tagger-present-tags-header-line'
\r
143 +instead of this function."
\r
146 + (notmuch-tagger-separate-elems
\r
147 + (mapcar #'notmuch-tagger-make-body-link tags)
\r
151 (provide 'notmuch-tagger)
\r
152 ;;; notmuch-tagger.el ends here
\r