[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 4b / 33ffaffafa7facc19face98a3cc3dc947b6ef6
1 Return-Path: <markwalters1009@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 74547431FAF\r
6         for <notmuch@notmuchmail.org>; Sat,  4 May 2013 06:01:39 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id Po3EzUKrAus1 for <notmuch@notmuchmail.org>;\r
18         Sat,  4 May 2013 06:01:33 -0700 (PDT)\r
19 Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com\r
20         [209.85.212.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 2A2AF431FC0\r
23         for <notmuch@notmuchmail.org>; Sat,  4 May 2013 06:01:33 -0700 (PDT)\r
24 Received: by mail-wi0-f175.google.com with SMTP id h11so1363247wiv.8\r
25         for <notmuch@notmuchmail.org>; Sat, 04 May 2013 06:01:32 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
28         :references; bh=Tzkgjg4d3ubib606ysb8b/eQysKyODZ6mt8VbIZJkes=;\r
29         b=NBFUXUA01QZ5yIRYouyVYOpXedaEcvti6/oL7tZTADGgrlqdpkLfQo1cMiosyICqw/\r
30         mxIDvCYSjbWmnyAevRww7QLpPLPXCP5V/iHpdPFI+kXUdNt32bEpWGDzHDH7NbgxIfwV\r
31         mtcTG2+AP5qu3KQM2RqWQpAuLbEQ223DUFB9hjWxVETjTeOiIPhWqoDM1TH1uTrQAehW\r
32         5cPU8xMlURBQc3u22j7rNhlZ6ekPbj77g35ErvczLERbftU8cJ5bVvLTyK3MSVluaSai\r
33         rIBI6mzjuH/4WYCE61mR9KLKmwRaAAS4+FxIExg48GIn4IndcOopUPoSGbLQ3jJ1mvnr\r
34         UvVA==\r
35 X-Received: by 10.180.188.141 with SMTP id ga13mr2013674wic.9.1367672492086;\r
36         Sat, 04 May 2013 06:01:32 -0700 (PDT)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPSA id k5sm3129210wiy.5.2013.05.04.06.01.30\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Sat, 04 May 2013 06:01:31 -0700 (PDT)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH 3/4] emacs: show: move the insertion of the header button to\r
45         the top level\r
46 Date: Sat,  4 May 2013 14:01:16 +0100\r
47 Message-Id: <1367672478-12247-4-git-send-email-markwalters1009@gmail.com>\r
48 X-Mailer: git-send-email 1.7.9.1\r
49 In-Reply-To: <1367672478-12247-1-git-send-email-markwalters1009@gmail.com>\r
50 References: <1367672478-12247-1-git-send-email-markwalters1009@gmail.com>\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Sat, 04 May 2013 13:01:39 -0000\r
64 \r
65 Previously each of the part insertion handlers inserted the part\r
66 button themselves. Move this up into\r
67 notmuch-show-insert-bodypart. Since a small number of the handlers\r
68 modify the button (the encryption/signature ones) we need to pass the\r
69 header button as an argument into the individual part insertion\r
70 handlers.\r
71 \r
72 The patch is large but mostly simple. The only things of note are that\r
73 we let the text/plain handler insert part buttons itself (as it does\r
74 not always insert one and it applies motmuch-wash to the whole part\r
75 including the button. Also this is by far the most important case so\r
76 this reduces the risk of annoying side effects.\r
77 \r
78 The handler for inline-patch-fake-part is called from notmuch wash not\r
79 from notmuch-show-insert-bodypart so that needs to insert the header\r
80 button itself (rather than relying on notmuch-show-insert-part-*/*).\r
81 ---\r
82  emacs/notmuch-show.el |   91 +++++++++++++++++++++++-------------------------\r
83  1 files changed, 44 insertions(+), 47 deletions(-)\r
84 \r
85 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
86 index f984143..2c48b24 100644\r
87 --- a/emacs/notmuch-show.el\r
88 +++ b/emacs/notmuch-show.el\r
89 @@ -575,8 +575,7 @@ message at DEPTH in the current thread."\r
90    (mapcar (lambda (inner-part) (plist-get inner-part :content-type))\r
91           (plist-get part :content)))\r
92  \r
93 -(defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth depth declared-type)\r
94 -  (notmuch-show-insert-part-header nth declared-type content-type nil)\r
95 +(defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth depth declared-type button)\r
96    (let ((chosen-type (car (notmuch-multipart/alternative-choose (notmuch-show-multipart/*-to-list part))))\r
97         (inner-parts (plist-get part :content))\r
98         (start (point)))\r
99 @@ -653,8 +652,7 @@ message at DEPTH in the current thread."\r
100           content-type)\r
101        nil)))\r
102  \r
103 -(defun notmuch-show-insert-part-multipart/related (msg part content-type nth depth declared-type)\r
104 -  (notmuch-show-insert-part-header nth declared-type content-type nil)\r
105 +(defun notmuch-show-insert-part-multipart/related (msg part content-type nth depth declared-type button)\r
106    (let ((inner-parts (plist-get part :content))\r
107         (start (point)))\r
108  \r
109 @@ -673,16 +671,15 @@ message at DEPTH in the current thread."\r
110        (indent-rigidly start (point) 1)))\r
111    t)\r
112  \r
113 -(defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth declared-type)\r
114 -  (let ((button (notmuch-show-insert-part-header nth declared-type content-type nil)))\r
115 -    (button-put button 'face 'notmuch-crypto-part-header)\r
116 -    ;; add signature status button if sigstatus provided\r
117 -    (if (plist-member part :sigstatus)\r
118 -       (let* ((from (notmuch-show-get-header :From msg))\r
119 -              (sigstatus (car (plist-get part :sigstatus))))\r
120 -         (notmuch-crypto-insert-sigstatus-button sigstatus from))\r
121 -      ;; if we're not adding sigstatus, tell the user how they can get it\r
122 -      (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts.")))\r
123 +(defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth declared-type button)\r
124 +  (button-put button 'face 'notmuch-crypto-part-header)\r
125 +  ;; add signature status button if sigstatus provided\r
126 +  (if (plist-member part :sigstatus)\r
127 +      (let* ((from (notmuch-show-get-header :From msg))\r
128 +            (sigstatus (car (plist-get part :sigstatus))))\r
129 +       (notmuch-crypto-insert-sigstatus-button sigstatus from))\r
130 +    ;; if we're not adding sigstatus, tell the user how they can get it\r
131 +    (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))\r
132  \r
133    (let ((inner-parts (plist-get part :content))\r
134         (start (point)))\r
135 @@ -695,20 +692,19 @@ message at DEPTH in the current thread."\r
136        (indent-rigidly start (point) 1)))\r
137    t)\r
138  \r
139 -(defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth declared-type)\r
140 -  (let ((button (notmuch-show-insert-part-header nth declared-type content-type nil)))\r
141 -    (button-put button 'face 'notmuch-crypto-part-header)\r
142 -    ;; add encryption status button if encstatus specified\r
143 -    (if (plist-member part :encstatus)\r
144 -       (let ((encstatus (car (plist-get part :encstatus))))\r
145 -         (notmuch-crypto-insert-encstatus-button encstatus)\r
146 -         ;; add signature status button if sigstatus specified\r
147 -         (if (plist-member part :sigstatus)\r
148 -             (let* ((from (notmuch-show-get-header :From msg))\r
149 -                    (sigstatus (car (plist-get part :sigstatus))))\r
150 -               (notmuch-crypto-insert-sigstatus-button sigstatus from))))\r
151 -      ;; if we're not adding encstatus, tell the user how they can get it\r
152 -      (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts.")))\r
153 +(defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth declared-type button)\r
154 +  (button-put button 'face 'notmuch-crypto-part-header)\r
155 +  ;; add encryption status button if encstatus specified\r
156 +  (if (plist-member part :encstatus)\r
157 +      (let ((encstatus (car (plist-get part :encstatus))))\r
158 +       (notmuch-crypto-insert-encstatus-button encstatus)\r
159 +       ;; add signature status button if sigstatus specified\r
160 +       (if (plist-member part :sigstatus)\r
161 +           (let* ((from (notmuch-show-get-header :From msg))\r
162 +                  (sigstatus (car (plist-get part :sigstatus))))\r
163 +             (notmuch-crypto-insert-sigstatus-button sigstatus from))))\r
164 +    ;; if we're not adding encstatus, tell the user how they can get it\r
165 +    (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))\r
166  \r
167    (let ((inner-parts (plist-get part :content))\r
168         (start (point)))\r
169 @@ -721,8 +717,7 @@ message at DEPTH in the current thread."\r
170        (indent-rigidly start (point) 1)))\r
171    t)\r
172  \r
173 -(defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth declared-type)\r
174 -  (notmuch-show-insert-part-header nth declared-type content-type nil)\r
175 +(defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth declared-type button)\r
176    (let ((inner-parts (plist-get part :content))\r
177         (start (point)))\r
178      ;; Show all of the parts.\r
179 @@ -734,8 +729,7 @@ message at DEPTH in the current thread."\r
180        (indent-rigidly start (point) 1)))\r
181    t)\r
182  \r
183 -(defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type)\r
184 -  (notmuch-show-insert-part-header nth declared-type content-type nil)\r
185 +(defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type button)\r
186    (let* ((message (car (plist-get part :content)))\r
187          (body (car (plist-get message :body)))\r
188          (start (point)))\r
189 @@ -756,7 +750,7 @@ message at DEPTH in the current thread."\r
190        (indent-rigidly start (point) 1)))\r
191    t)\r
192  \r
193 -(defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type)\r
194 +(defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type button)\r
195    (let ((start (point)))\r
196      ;; If this text/plain part is not the first part in the message,\r
197      ;; insert a header to make this clear.\r
198 @@ -769,8 +763,7 @@ message at DEPTH in the current thread."\r
199         (run-hook-with-args 'notmuch-show-insert-text/plain-hook msg depth))))\r
200    t)\r
201  \r
202 -(defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth declared-type)\r
203 -  (notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))\r
204 +(defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth declared-type button)\r
205    (insert (with-temp-buffer\r
206             (insert (notmuch-get-bodypart-content msg part nth notmuch-show-process-crypto))\r
207             ;; notmuch-get-bodypart-content provides "raw", non-converted\r
208 @@ -793,8 +786,8 @@ message at DEPTH in the current thread."\r
209    t)\r
210  \r
211  ;; For backwards compatibility.\r
212 -(defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type)\r
213 -  (notmuch-show-insert-part-text/calendar msg part content-type nth depth declared-type))\r
214 +(defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type button)\r
215 +  (notmuch-show-insert-part-text/calendar msg part content-type nth depth declared-type button))\r
216  \r
217  (defun notmuch-show-get-mime-type-of-application/octet-stream (part)\r
218    ;; If we can deduce a MIME type from the filename of the attachment,\r
219 @@ -813,10 +806,10 @@ message at DEPTH in the current thread."\r
220           nil))))\r
221  \r
222  ;; Handler for wash generated inline patch fake parts.\r
223 -(defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type)\r
224 -  (notmuch-show-insert-part-*/* msg part content-type nth depth declared-type))\r
225 +(defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type button)\r
226 +  (notmuch-show-insert-part-*/* msg part content-type nth depth declared-type button))\r
227  \r
228 -(defun notmuch-show-insert-part-text/html (msg part content-type nth depth declared-type)\r
229 +(defun notmuch-show-insert-part-text/html (msg part content-type nth depth declared-type button)\r
230    ;; text/html handler to work around bugs in renderers and our\r
231    ;; invisibile parts code. In particular w3m sets up a keymap which\r
232    ;; "leaks" outside the invisible region and causes strange effects\r
233 @@ -824,11 +817,10 @@ message at DEPTH in the current thread."\r
234    ;; tell w3m not to set a keymap (so the normal notmuch-show-mode-map\r
235    ;; remains).\r
236    (let ((mm-inline-text-html-with-w3m-keymap nil))\r
237 -    (notmuch-show-insert-part-*/* msg part content-type nth depth declared-type)))\r
238 +    (notmuch-show-insert-part-*/* msg part content-type nth depth declared-type button)))\r
239  \r
240 -(defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type)\r
241 +(defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type button)\r
242    ;; This handler _must_ succeed - it is the handler of last resort.\r
243 -  (notmuch-show-insert-part-header nth content-type declared-type (plist-get part :filename))\r
244    (notmuch-mm-display-part-inline msg part nth content-type notmuch-show-process-crypto)\r
245    t)\r
246  \r
247 @@ -851,13 +843,13 @@ message at DEPTH in the current thread."\r
248  \r
249  ;; \f\r
250 \r
251  \r
252 -(defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth declared-type)\r
253 +(defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth declared-type button)\r
254    (let ((handlers (notmuch-show-handlers-for content-type)))\r
255      ;; Run the content handlers until one of them returns a non-nil\r
256      ;; value.\r
257      (while (and handlers\r
258                 (not (condition-case err\r
259 -                        (funcall (car handlers) msg part content-type nth depth declared-type)\r
260 +                        (funcall (car handlers) msg part content-type nth depth declared-type button)\r
261                        (error (progn\r
262                                 (insert "!!! Bodypart insert error: ")\r
263                                 (insert (error-message-string err))\r
264 @@ -885,6 +877,9 @@ message at DEPTH in the current thread."\r
265    "Insert the body part PART at depth DEPTH in the current thread.\r
266  \r
267  If HIDE is non-nil then initially hide this part."\r
268 +\r
269 +  ;; We handle text/plain specially as its code does things before\r
270 +  ;; inserting a part button (and does not always insert a part button).\r
271    (let* ((content-type (downcase (plist-get part :content-type)))\r
272          (mime-type (or (and (string= content-type "application/octet-stream")\r
273                              (notmuch-show-get-mime-type-of-application/octet-stream part))\r
274 @@ -892,9 +887,11 @@ If HIDE is non-nil then initially hide this part."\r
275                              "text/x-diff")\r
276                         content-type))\r
277          (nth (plist-get part :id))\r
278 -        (beg (point)))\r
279 +        (beg (point))\r
280 +        (button (unless (string= mime-type "text/plain")\r
281 +                  (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename)))))\r
282  \r
283 -    (notmuch-show-insert-bodypart-internal msg part mime-type nth depth content-type)\r
284 +    (notmuch-show-insert-bodypart-internal msg part mime-type nth depth content-type button)\r
285      ;; Some of the body part handlers leave point somewhere up in the\r
286      ;; part, so we make sure that we're down at the end.\r
287      (goto-char (point-max))\r
288 -- \r
289 1.7.9.1\r
290 \r