Re: [PATCH] configure: Use $prefix for emacs, even when pkg-config is available.
[notmuch-archives.git] / 63 / 7d61b09ad4bd90d1e4aea28ee25412af4c49eb
1 Return-Path: <amdragon@mit.edu>\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 D7BEA431FC7\r
6         for <notmuch@notmuchmail.org>; Mon, 19 Nov 2012 21:13:23 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 0fe4kFU7CKU2 for <notmuch@notmuchmail.org>;\r
16         Mon, 19 Nov 2012 21:13:23 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
18         [18.9.25.13])\r
19         by olra.theworths.org (Postfix) with ESMTP id 03F15431FBC\r
20         for <notmuch@notmuchmail.org>; Mon, 19 Nov 2012 21:13:22 -0800 (PST)\r
21 X-AuditID: 1209190d-b7f906d0000008de-1a-50ab1172ec0d\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 1D.34.02270.2711BA05; Tue, 20 Nov 2012 00:13:22 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qAK5DMa7009392; \r
27         Tue, 20 Nov 2012 00:13:22 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qAK5DKOP029680\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Tue, 20 Nov 2012 00:13:21 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1Tag9A-0000E7-9K; Tue, 20 Nov 2012 00:13:20 -0500\r
37 Date: Tue, 20 Nov 2012 00:13:20 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Damien Cassou <damien.cassou@gmail.com>\r
40 Subject: Re: [PATCH 1/4] Add a thread's tags to emacs header-line\r
41 Message-ID: <20121120051320.GA32514@mit.edu>\r
42 References: <1353266322-20318-1-git-send-email-damien.cassou@gmail.com>\r
43         <1353266322-20318-2-git-send-email-damien.cassou@gmail.com>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=iso-8859-1\r
46 Content-Disposition: inline\r
47 Content-Transfer-Encoding: 8bit\r
48 In-Reply-To: <1353266322-20318-2-git-send-email-damien.cassou@gmail.com>\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)\r
50 X-Brightmail-Tracker:\r
51  H4sIAAAAAAAAA+NgFlrOKsWRmVeSWpSXmKPExsUixG6nolskuDrAoGWJmsWuu1uZLK7fnMns\r
52         wOSxc9Zddo9nq24xBzBFcdmkpOZklqUW6dslcGX8bLvBXnBUrmLu3PlMDYyTJLoYOTkkBEwk\r
53         3rduZYKwxSQu3FvP1sXIxSEksI9R4t+zXjaQhJDABkaJlgfKEPZJJolXS8UgipYwSpxpnsAK\r
54         kmARUJXYfv0XI4jNJqAhsW3/cjBbREBb4s3SDrAaZgEjifs7pjOD2MICjhKtU1aC2bwCOhIL\r
55         rn1lhRjayiixYuIORoiEoMTJmU9YIJp1JHZuvQN0EQeQLS2x/B8HRFheonnrbLA5nAIeEnOu\r
56         zwVrFRVQkZhychvbBEbhWUgmzUIyaRbCpFlIJi1gZFnFKJuSW6Wbm5iZU5yarFucnJiXl1qk\r
57         a6SXm1mil5pSuokRFAeckrw7GN8dVDrEKMDBqMTD+yBhVYAQa2JZcWXuIUZJDiYlUd4X/KsD\r
58         hPiS8lMqMxKLM+KLSnNSiw8xSnAwK4nwNpUDlfOmJFZWpRblw6SkOViUxHmvpNz0FxJITyxJ\r
59         zU5NLUgtgsnKcHAoSfByCQANFSxKTU+tSMvMKUFIM3FwggznARouAVLDW1yQmFucmQ6RP8Wo\r
60         y7FwTfsTRiGWvPy8VClxXg2QIgGQoozSPLg5sPT1ilEc6C1hXjaQKh5g6oOb9ApoCRPQkmsB\r
61         y0GWlCQipKQaGAPvpMiouzUt/lDZWqSxc/a2n24S+1fxfnk6cV2d7Y7lfl4cPk8PNti59vit\r
62         2+ClzRd97MTPorUzs2UdNOcaempUql54uUL45zoRI83eHxNjuyZ+uMR6/x/zz3rGM5zrnk2a\r
63         uovV1K+baWVjo/CBwBeOfak1M/MrgrPbLz1+fiulKkTuVvCjYCWW4oxEQy3mouJEAIcyJDg6        AwAA\r
64 Cc: notmuch mailing list <notmuch@notmuchmail.org>\r
65 X-BeenThere: notmuch@notmuchmail.org\r
66 X-Mailman-Version: 2.1.13\r
67 Precedence: list\r
68 List-Id: "Use and development of the notmuch mail system."\r
69         <notmuch.notmuchmail.org>\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
73 List-Post: <mailto:notmuch@notmuchmail.org>\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
77 X-List-Received-Date: Tue, 20 Nov 2012 05:13:24 -0000\r
78 \r
79 Quoth Damien Cassou on Nov 18 at  8:18 pm:\r
80 > Signed-off-by: Damien Cassou <damien.cassou@gmail.com>\r
81 > ---\r
82 >  emacs/notmuch-show.el   |   24 +++++++++++++++++++++---\r
83 >  emacs/notmuch-tagger.el |   44 ++++++++++++++++++++++++++++++++++++++++++++\r
84 >  2 files changed, 65 insertions(+), 3 deletions(-)\r
85 >  create mode 100644 emacs/notmuch-tagger.el\r
86\r
87 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
88 > index 5b3e70e..988e27c 100644\r
89 > --- a/emacs/notmuch-show.el\r
90 > +++ b/emacs/notmuch-show.el\r
91 > @@ -36,6 +36,7 @@\r
92 >  (require 'notmuch-mua)\r
93 >  (require 'notmuch-crypto)\r
94 >  (require 'notmuch-print)\r
95 > +(require 'notmuch-tagger)\r
96 >  \r
97 >  (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))\r
98 >  (declare-function notmuch-fontify-headers "notmuch" nil)\r
99 > @@ -1121,11 +1122,28 @@ function is used."\r
100 >  \r
101 >        (jit-lock-register #'notmuch-show-buttonise-links)\r
102 >  \r
103 > -      ;; Set the header line to the subject of the first message.\r
104 > -      (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))\r
105 > -\r
106 > +      (notmuch-show-update-header-line)\r
107 >        (run-hooks 'notmuch-show-hook))))\r
108 >  \r
109 > +(defun notmuch-show-thread-tags ()\r
110 > +  "Return the list of tags for the current thread."\r
111 > +  (let ((tags (list)))\r
112 > +    (notmuch-show-mapc (lambda ()\r
113 > +                      (mapcar (lambda (elt)\r
114 > +                                ;; Avoid adding duplicate tags\r
115 > +                                (add-to-list 'tags elt))\r
116 > +                              (notmuch-show-get-tags))))\r
117 > +    tags))\r
118 > +\r
119 > +(defun notmuch-show-update-header-line ()\r
120 > +  "Make the header-line show the thread's subject and tags."\r
121 > +  (let ((thread-subject (notmuch-show-strip-re (notmuch-show-get-subject))))\r
122 > +    (setq header-line-format\r
123 > +       (list\r
124 > +        thread-subject\r
125 > +        " "\r
126 > +        (notmuch-tagger-present-tags-header-line (notmuch-show-thread-tags))))))\r
127 > +\r
128 >  (defun notmuch-show-capture-state ()\r
129 >    "Capture the state of the current buffer.\r
130 >  \r
131 > diff --git a/emacs/notmuch-tagger.el b/emacs/notmuch-tagger.el\r
132 > new file mode 100644\r
133 > index 0000000..5ca190e\r
134 > --- /dev/null\r
135 > +++ b/emacs/notmuch-tagger.el\r
136 > @@ -0,0 +1,44 @@\r
137 > +;; notmuch-tagger.el --- Library to improve the way tags are displayed\r
138 > +;;\r
139 > +;; Copyright © Damien Cassou\r
140 > +;;\r
141 > +;; This file is part of Notmuch.\r
142 > +;;\r
143 > +;; Notmuch is free software: you can redistribute it and/or modify it\r
144 > +;; under the terms of the GNU General Public License as published by\r
145 > +;; the Free Software Foundation, either version 3 of the License, or\r
146 > +;; (at your option) any later version.\r
147 > +;;\r
148 > +;; Notmuch is distributed in the hope that it will be useful, but\r
149 > +;; WITHOUT ANY WARRANTY; without even the implied warranty of\r
150 > +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
151 > +;; General Public License for more details.\r
152 > +;;\r
153 > +;; You should have received a copy of the GNU General Public License\r
154 > +;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.\r
155 > +;;\r
156 > +;; Authors: Damien Cassou <damien.cassou@gmail.com>\r
157 > +;;; Commentary:\r
158 > +;;\r
159 > +;;; Code:\r
160 > +;;\r
161 > +(defun notmuch-tagger-separate-elems (list sep)\r
162 \r
163 notmuch-tagger-intersperse?\r
164 \r
165 This could also reasonably go in notmuch-lib.el as a general utility.\r
166 \r
167 (How do neither Elisp nor 'cl have an intersperse?)\r
168 \r
169 > +  "Return a list with all elements of LIST separated by SEP."\r
170 > +  (let ((first t)\r
171 > +        (res nil))\r
172 > +    (dolist (elt (reverse list) res)\r
173 \r
174 (dolist (elt list (nreverse res)) ...) to save a list copy?\r
175 \r
176 > +      (unless first\r
177 > +        (push sep res))\r
178 > +      (setq first nil)\r
179 > +      (push elt res))))\r
180 > +\r
181 > +(defun notmuch-tagger-present-tags-header-line (tags)\r
182 > +  "Return a property list to present TAGS in emacs header-line."\r
183 > +  (list\r
184 > +   "("\r
185 > +   (notmuch-tagger-separate-elems tags " ")\r
186 > +   ")"))\r
187 > +\r
188 > +\r
189 > +(provide 'notmuch-tagger)\r
190 > +;;; notmuch-tagger.el ends here\r