1 Return-Path: <dme@dme.org>
\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 452E4429E3B
\r
6 for <notmuch@notmuchmail.org>; Tue, 13 May 2014 02:49:33 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 YrrivtFBEK2s for <notmuch@notmuchmail.org>;
\r
16 Tue, 13 May 2014 02:49:25 -0700 (PDT)
\r
17 Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com
\r
18 [74.125.82.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 23F42431FDE for <notmuch@notmuchmail.org>; Tue, 13 May 2014 02:49:19 -0700
\r
22 Received: by mail-wg0-f43.google.com with SMTP id l18so104703wgh.2
\r
23 for <notmuch@notmuchmail.org>; Tue, 13 May 2014 02:49:17 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=1e100.net; s=20130820;
\r
26 h=x-gm-message-state:to:subject:in-reply-to:references:user-agent
\r
27 :from:date:message-id:mime-version:content-type;
\r
28 bh=i4Gs0ziVGXEA0VXTjk7M57aatXErJISgu9FVRnnRP18=;
\r
29 b=IvqjMce06y9ja0OeFMhxO6VPQkCJ2Cw0unPpE28OGgAP0rdQ+MsX7syKCNzuEG1MM5
\r
30 XFEPcdO0v9LnWm5MBgKrTtber0PLSMYzTPb1TkJ9zNuRXo5IBymgxyvJno9U0El01zQL
\r
31 eqiDPAacJ/buRI4/ypVn/s1mYlO5oybqtk9FyC7JhJbReqUTxXtArm1NhBV2foVQ8MSv
\r
32 BCShtKJq8MuJFcVBIxoAUzQ8hz9rvzbb97o+sn5ST/qPtubmcz6Ew+DmZh8wKgxHr599
\r
33 ZfGyEbMp0qALjpdO8x1QAkLxzjSfkAXhlu2xA6bCJLJBIcso3IFrfT3zpozd0qaJpbWa
\r
36 ALoCoQnRcZjNFXaqCcsWw8KzN0ENY5fiGozmFETeTRzaZqWacaphiCbX/iL4E6/xBd+FyugDClln
\r
37 X-Received: by 10.194.62.234 with SMTP id b10mr6974004wjs.48.1399974557884;
\r
38 Tue, 13 May 2014 02:49:17 -0700 (PDT)
\r
39 Received: from localhost ([2a01:348:1a2:1:a288:b4ff:fe8a:77d8])
\r
40 by mx.google.com with ESMTPSA id bj5sm20999609wib.3.2014.05.13.02.49.16
\r
41 for <multiple recipients>
\r
42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
43 Tue, 13 May 2014 02:49:17 -0700 (PDT)
\r
44 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
\r
45 Subject: Re: [PATCH v3 2/9] emacs/show: Allow the user to decide when part
\r
46 headers should be inserted
\r
47 In-Reply-To: <87ppjik5jo.fsf@qmul.ac.uk>
\r
48 References: <87sixdujkv.fsf@qmul.ac.uk>
\r
49 <1399897769-26809-1-git-send-email-dme@dme.org>
\r
50 <1399897769-26809-3-git-send-email-dme@dme.org>
\r
51 <87ppjik5jo.fsf@qmul.ac.uk>
\r
52 User-Agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1
\r
53 (x86_64-pc-linux-gnu)
\r
54 From: David Edmondson <dme@dme.org>
\r
55 Date: Tue, 13 May 2014 10:49:10 +0100
\r
56 Message-ID: <cuny4y657qh.fsf@hotblack-desiato.hh.sledj.net>
\r
58 Content-Type: multipart/signed; boundary="=-=-=";
\r
59 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
60 X-BeenThere: notmuch@notmuchmail.org
\r
61 X-Mailman-Version: 2.1.13
\r
63 List-Id: "Use and development of the notmuch mail system."
\r
64 <notmuch.notmuchmail.org>
\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
68 List-Post: <mailto:notmuch@notmuchmail.org>
\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
72 X-List-Received-Date: Tue, 13 May 2014 09:49:33 -0000
\r
75 Content-Type: text/plain
\r
76 Content-Transfer-Encoding: quoted-printable
\r
78 On Mon, May 12 2014, Mark Walters wrote:
\r
79 > On Mon, 12 May 2014, David Edmondson <dme@dme.org> wrote:
\r
80 >> Make the function that determines whether a part header should be
\r
81 >> inserted a user controlled, with some example functions.
\r
83 >> emacs/notmuch-show.el | 21 +++++++++++++++++++--
\r
84 >> 1 file changed, 19 insertions(+), 2 deletions(-)
\r
86 >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
87 >> index ec99141..f78a0ab 100644
\r
88 >> --- a/emacs/notmuch-show.el
\r
89 >> +++ b/emacs/notmuch-show.el
\r
90 >> @@ -135,6 +135,17 @@ indentation."
\r
92 >> :group 'notmuch-show)
\r
94 >> +(defcustom notmuch-show-insert-header-p-function 'notmuch-show-insert-h=
\r
96 >> + "A function to call to determine whether a MIME part should have a he=
\r
99 >> +The function is passed one argument, PART - the MIME part in
\r
101 >> + :type 'function
\r
102 >> + :group 'notmuch-show
\r
103 >> + :options '(notmuch-show-insert-header-p-smart
\r
104 >> + notmuch-show-insert-header-p-always
\r
105 >> + notmuch-show-insert-header-p-never))
\r
108 > I think this is nice as a defcustom for testing/seeing what happens, but =
\r
110 > not sure we want it exposed longer term: for example never makes it
\r
111 > nearly impossible to view pdf parts.
\r
121 >> (defvar notmuch-show-thread-id nil)
\r
122 >> (make-variable-buffer-local 'notmuch-show-thread-id)
\r
123 >> (put 'notmuch-show-thread-id 'permanent-local t)
\r
124 >> @@ -880,12 +891,18 @@ message at DEPTH in the current thread."
\r
128 >> -(defun notmuch-show-insert-header-p (part)
\r
129 >> +(defun notmuch-show-insert-header-p-smart (part)
\r
130 >> "Return non-NIL if a header button should be inserted for this part."
\r
131 >> (let ((mime-type (notmuch-show-mime-type part)))
\r
132 >> (not (and (string=3D mime-type "text/plain")
\r
133 >> (<=3D (plist-get part :id) 1)))))
\r
135 >> +(defun notmuch-show-insert-header-p-always (part)
\r
138 >> +(defun notmuch-show-insert-header-p-never (part)
\r
141 >> (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
\r
142 >> "Insert the body part PART at depth DEPTH in the current thread.
\r
144 >> @@ -904,7 +921,7 @@ useful for quoting in replies)."
\r
145 >> ;; We omit the part button for the first (or only) part if
\r
146 >> ;; this is text/plain, or HIDE is 'no-buttons.
\r
147 >> (button (when (and (not (equal hide 'no-buttons))
\r
148 >> - (notmuch-show-insert-header-p part))
\r
149 >> + (funcall notmuch-show-insert-header-p-function part))
\r
150 >> (notmuch-show-insert-part-header nth mime-type content-type (plist=
\r
151 -get part :filename))))
\r
152 >> (content-beg (point)))
\r
157 >> _______________________________________________
\r
158 >> notmuch mailing list
\r
159 >> notmuch@notmuchmail.org
\r
160 >> http://notmuchmail.org/mailman/listinfo/notmuch
\r
163 Content-Type: application/pgp-signature; name="signature.asc"
\r
165 -----BEGIN PGP SIGNATURE-----
\r
168 iKYEARECAGYFAlNx6pZfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl
\r
169 bnBncC5maWZ0aGhvcnNlbWFuLm5ldDc1M0Y5NDJDMEExNjc3MDE4OURGMUYyMDY5
\r
170 RUNEMEFCRjA0OTY1MTYACgkQaezQq/BJZRYiKgCfc9Jif6Pkeu2q2q43sZ0Ei61Y
\r
171 Z6AAn0TgH7Ss/7Pu8SF4GuuECgNOFMTq
\r
173 -----END PGP SIGNATURE-----
\r