database error
[notmuch-archives.git] / ff / 4397a3c665ef924d33e7cf7f069614d04001b6
1 Return-Path: <m.walters@qmul.ac.uk>\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 AFFEA431FBD\r
6         for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 15:06:59 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 zUsH8BZwJp4S for <notmuch@notmuchmail.org>;\r
17         Sun, 18 Nov 2012 15:06:57 -0800 (PST)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 78375431FB6\r
22         for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 15:06:57 -0800 (PST)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1TaDwx-0007TB-L3; Sun, 18 Nov 2012 23:06:54 +0000\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1TaDwx-0001u1-81; Sun, 18 Nov 2012 23:06:51 +0000\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Damien Cassou <damien.cassou@gmail.com>,\r
33         notmuch mailing list <notmuch@notmuchmail.org>\r
34 Subject: Re: [PATCH 3/4] emacs: Make tags that appear in `notmuch-show'\r
35         clickable\r
36 In-Reply-To: <1353266322-20318-4-git-send-email-damien.cassou@gmail.com>\r
37 References: <1353266322-20318-1-git-send-email-damien.cassou@gmail.com>\r
38         <1353266322-20318-4-git-send-email-damien.cassou@gmail.com>\r
39 User-Agent: Notmuch/0.14+81~g9730584 (http://notmuchmail.org) Emacs/23.4.1\r
40         (x86_64-pc-linux-gnu)\r
41 Date: Sun, 18 Nov 2012 23:06:50 +0000\r
42 Message-ID: <87a9uepl2t.fsf@qmul.ac.uk>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 X-Sender-Host-Address: 93.97.24.31\r
46 X-QM-SPAM-Info: Sender has good ham record.  :)\r
47 X-QM-Body-MD5: 446cb36ac7d91dd2b6fb86fc36d53131 (of first 20000 bytes)\r
48 X-SpamAssassin-Score: -1.8\r
49 X-SpamAssassin-SpamBar: -\r
50 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
51         determine if it is\r
52         spam. We require at least 5.0 points to mark a message as spam.\r
53         This message scored -1.8 points.\r
54         Summary of the scoring: \r
55         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
56         *      medium trust\r
57         *      [138.37.6.40 listed in list.dnswl.org]\r
58         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
59         provider *      (markwalters1009[at]gmail.com)\r
60         *  0.5 AWL AWL: From: address is in the auto white-list\r
61 X-QM-Scan-Virus: ClamAV says the message is clean\r
62 X-BeenThere: notmuch@notmuchmail.org\r
63 X-Mailman-Version: 2.1.13\r
64 Precedence: list\r
65 List-Id: "Use and development of the notmuch mail system."\r
66         <notmuch.notmuchmail.org>\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
70 List-Post: <mailto:notmuch@notmuchmail.org>\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
74 X-List-Received-Date: Sun, 18 Nov 2012 23:06:59 -0000\r
75 \r
76 \r
77 Hi\r
78 \r
79 This patch adds buttons for every tag in show mode which means that\r
80 tabbing down to an attachment (or other button) is rather slower. As\r
81 someone who is not going to use the tag buttons (at least not very\r
82 often) Is it possible to avoid this? perhaps by making the button\r
83 optional or making the button only mouse clickable? (Since the buttons\r
84 in the headerline are not tabbable to then the latter might be\r
85 reasonable.)\r
86 \r
87 Best wishes\r
88 \r
89 Mark\r
90 \r
91 \r
92 On Sun, 18 Nov 2012, Damien Cassou <damien.cassou@gmail.com> wrote:\r
93 > Signed-off-by: Damien Cassou <damien.cassou@gmail.com>\r
94 > ---\r
95 >  emacs/notmuch-show.el   |    9 +++++----\r
96 >  emacs/notmuch-tagger.el |   33 +++++++++++++++++++++++++++++++++\r
97 >  2 files changed, 38 insertions(+), 4 deletions(-)\r
98 >\r
99 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
100 > index 988e27c..379c8cd 100644\r
101 > --- a/emacs/notmuch-show.el\r
102 > +++ b/emacs/notmuch-show.el\r
103 > @@ -431,10 +431,11 @@ message at DEPTH in the current thread."\r
104 >           (notmuch-show-clean-address (plist-get headers :From))\r
105 >           " ("\r
106 >           date\r
107 > -         ") ("\r
108 > -         (propertize (mapconcat 'identity tags " ")\r
109 > -                     'face 'notmuch-tag-face)\r
110 > -         ")\n")\r
111 > +         ") "\r
112 > +         (propertize\r
113 > +          (format-mode-line (notmuch-tagger-present-tags tags))\r
114 > +          'face 'notmuch-tag-face)\r
115 > +         "\n")\r
116 >      (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))\r
117 >  \r
118 >  (defun notmuch-show-insert-header (header header-value)\r
119 > diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el\r
120 > index 19a6c7e..379a905 100644\r
121 > --- a/emacs/notmuch-tagger.el\r
122 > +++ b/emacs/notmuch-tagger.el\r
123 > @@ -53,12 +53,21 @@ test if the library is present before calling this function."\r
124 >    (let ((tag (header-button-get button 'notmuch-tagger-tag)))\r
125 >      (notmuch-tagger-goto-target tag)))\r
126 >  \r
127 > +(defun notmuch-tagger-body-button-action (button)\r
128 > +  "Open `notmuch-search' for the tag referenced by BUTTON."\r
129 > +  (let ((tag (button-get button 'notmuch-tagger-tag)))\r
130 > +    (notmuch-tagger-goto-target tag)))\r
131 > +\r
132 >  (eval-after-load "header-button"\r
133 >    '(define-button-type 'notmuch-tagger-header-button-type\r
134 >       'supertype 'header\r
135 >       'action    #'notmuch-tagger-header-button-action\r
136 >       'follow-link t))\r
137 >  \r
138 > +(define-button-type 'notmuch-tagger-body-button-type\r
139 > +  'action    #'notmuch-tagger-body-button-action\r
140 > +  'follow-link t)\r
141 > +\r
142 >  (defun notmuch-tagger-really-make-header-link (tag)\r
143 >     "Return a property list that presents a link to TAG.\r
144 >  \r
145 > @@ -82,6 +91,19 @@ if not."\r
146 >        (notmuch-tagger-really-make-header-link tag)\r
147 >      tag))\r
148 >  \r
149 > +(defun notmuch-tagger-make-body-link (tag)\r
150 > +  "Return a property list that presents a link to TAG.\r
151 > +The returned property list will work everywhere except in the\r
152 > +header-line. For a link that works on the header-line, prefer\r
153 > +`notmuch-tagger-make-header-link'."\r
154 > +  (let ((button (copy-sequence tag)))\r
155 > +    (make-text-button\r
156 > +     button nil\r
157 > +     'type 'notmuch-tagger-body-button-type\r
158 > +     'notmuch-tagger-tag tag\r
159 > +     'help-echo (format "%s: Search other messages like this" tag))\r
160 > +    button))\r
161 > +\r
162 >  (defun notmuch-tagger-present-tags-header-line (tags)\r
163 >    "Return a property list to present TAGS in emacs header-line."\r
164 >    (list\r
165 > @@ -91,6 +113,17 @@ if not."\r
166 >              " ")\r
167 >     ")"))\r
168 >  \r
169 > +(defun notmuch-tagger-present-tags (tags)\r
170 > +  "Return a property list to present TAGS in emacs.\r
171 > +If tags the result of this function is to be used within the\r
172 > +header-line, prefer `notmuch-tagger-present-tags-header-line'\r
173 > +instead of this function."\r
174 > +  (list\r
175 > +   "("\r
176 > +   (notmuch-tagger-separate-elems\r
177 > +    (mapcar #'notmuch-tagger-make-body-link tags)\r
178 > +            " ")\r
179 > +   ")"))\r
180 >  \r
181 >  (provide 'notmuch-tagger)\r
182 >  ;;; notmuch-tagger.el ends here\r
183 > -- \r
184 > 1.7.10.4\r
185 >\r
186 > _______________________________________________\r
187 > notmuch mailing list\r
188 > notmuch@notmuchmail.org\r
189 > http://notmuchmail.org/mailman/listinfo/notmuch\r