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 arlo.cworth.org (Postfix) with ESMTP id A4B666DE1AE1
\r
6 for <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:28 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.247 tagged_above=-999 required=5 tests=[AWL=0.323,
\r
12 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,
\r
14 RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]
\r
16 Received: from arlo.cworth.org ([127.0.0.1])
\r
17 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
18 with ESMTP id BztGXDzIMMIZ for <notmuch@notmuchmail.org>;
\r
19 Sun, 14 Feb 2016 10:40:26 -0800 (PST)
\r
20 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com
\r
21 [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id 4E6446DE10C1 for
\r
22 <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:24 -0800 (PST)
\r
23 Received: by mail-wm0-f68.google.com with SMTP id g62so12193406wme.2
\r
24 for <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:24 -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:in-reply-to:references;
\r
27 bh=gR4Pj1W0tfGTQleSCmGyahj2v5hHtQ3Nh6BbHawCCV0=;
\r
28 b=yC/ltf/HbW4VQpa+DjPZzGuvKauw0LfUf0tTAexe0lTGmk5YfbrjFX29/CxyXe6zaq
\r
29 8aGuxCb8zQGo/IzQrzMvuJx/06iHSnrJ/IjYO5GfnjNsG2rr0PSW3rU/qkIM8spuLLGj
\r
30 9p2qCsrO0hRMJzcdULzETEkTqQcI6fuV2mjvIawV3jz0oKaLLsVCd40Iw5hRg81d9ueM
\r
31 Boe/wy1w3bg0diIdBVHlsmxZdSJTbB54phIPHrqeYdCHFrru7xhxhQCqQDPgjVZ3ysHz
\r
32 HqTXBdcb02xk11IfmrMyWNAeSRGUwMeRCpNBx5BFnOzTGpJLtIXZUhw5+kCRUsDnxHZ+
\r
34 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
35 d=1e100.net; s=20130820;
\r
36 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
38 bh=gR4Pj1W0tfGTQleSCmGyahj2v5hHtQ3Nh6BbHawCCV0=;
\r
39 b=X14xEjzzHmkp/BWvgUrlP6sY5mX7t/GH6DBYmYibCd48sc2RqVMzxg+gH+SZFMnNGB
\r
40 /IkeUErE3WjQwl8RnSMAkgH5AHdN3+JFTDUaVKx5HtowsCY9JLHBW8iZG1aVYlP2Pr34
\r
41 4acd+BpPsUsoxL9XtK5pSa99j8qoane7nnAf8bxYa89A8Zsu0pUdRZ9J9OW5sJo6fkAr
\r
42 WyBZHcYHEqCsdfqnMHQuLDe/KcRY8JfU9tFb9GJUas7BAklYQ0c7jc/6chfqF4OnAHr6
\r
43 uVmiLprOlntxAS6dvEp3CAI8yYZYAm1T+Z/Q/rtFlO8QTjY0w8iAT1Ip1spnWnRBzfbH
\r
46 AG10YOT6d3U++MNY2ZLyY7bH1UU3cscTfoACu/k2B+FdnWRi6UsnbSPGNEd47p1HuuovTg==
\r
47 X-Received: by 10.28.0.86 with SMTP id 83mr9154703wma.63.1455475223066;
\r
48 Sun, 14 Feb 2016 10:40:23 -0800 (PST)
\r
49 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])
\r
50 by smtp.gmail.com with ESMTPSA id uo9sm21731546wjc.49.2016.02.14.10.40.22
\r
51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
52 Sun, 14 Feb 2016 10:40:22 -0800 (PST)
\r
53 From: Mark Walters <markwalters1009@gmail.com>
\r
54 To: notmuch@notmuchmail.org
\r
55 Subject: [PATCH v5 6/7] emacs/mua: Let user specify which parts get a header
\r
57 Date: Sun, 14 Feb 2016 18:39:58 +0000
\r
58 Message-Id: <1455475199-32622-7-git-send-email-markwalters1009@gmail.com>
\r
59 X-Mailer: git-send-email 2.1.4
\r
60 In-Reply-To: <1455475199-32622-1-git-send-email-markwalters1009@gmail.com>
\r
61 References: <1455475199-32622-1-git-send-email-markwalters1009@gmail.com>
\r
62 X-BeenThere: notmuch@notmuchmail.org
\r
63 X-Mailman-Version: 2.1.20
\r
65 List-Id: "Use and development of the notmuch mail system."
\r
66 <notmuch.notmuchmail.org>
\r
67 List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
73 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
74 X-List-Received-Date: Sun, 14 Feb 2016 18:40:28 -0000
\r
76 From: David Edmondson <dme@dme.org>
\r
78 Add a customizable function specifying which parts get a header when
\r
79 replying, and give some sensible possiblities. These are,
\r
81 1) all parts except multipart/*. (Subparts of a multipart part do
\r
82 receive a header button.)
\r
84 2) only included text/* parts.
\r
86 3) Exactly as in the show buffer.
\r
88 4) None at all. This means the reply contains a mish-mash of all the
\r
89 original message's parts.
\r
91 emacs/notmuch-mua.el | 30 ++++++++++++++++++++++++++----
\r
92 emacs/notmuch-show.el | 13 +++++++++++++
\r
93 2 files changed, 39 insertions(+), 4 deletions(-)
\r
95 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
\r
96 index a386d43..fcb3e95 100644
\r
97 --- a/emacs/notmuch-mua.el
\r
98 +++ b/emacs/notmuch-mua.el
\r
99 @@ -93,6 +93,23 @@ Note that these functions use `mail-citation-hook' if that is non-nil."
\r
100 :link '(custom-manual "(message)Insertion Variables")
\r
101 :group 'notmuch-reply)
\r
103 +(defcustom notmuch-mua-reply-insert-header-p-function
\r
104 + 'notmuch-show-reply-insert-header-p-trimmed
\r
105 + "Function to decide which parts get a header when replying.
\r
107 +This function specifies which parts of a mime message with
\r
108 +mutiple parts get a header."
\r
109 + :type '(radio (const :tag "All except multipart/* and hidden parts"
\r
110 + notmuch-show-reply-insert-header-p-trimmed)
\r
111 + (const :tag "Only for included text parts"
\r
112 + notmuch-show-reply-insert-header-p-minimal)
\r
113 + (const :tag "Exactly as in show view"
\r
114 + notmuch-show-insert-header-p)
\r
115 + (const :tag "No part headers"
\r
116 + notmuch-show-reply-insert-header-p-never)
\r
117 + (function :tag "Other"))
\r
118 + :group 'notmuch-reply)
\r
122 (defun notmuch-mua-get-switch-function ()
\r
123 @@ -223,10 +240,15 @@ Note that these functions use `mail-citation-hook' if that is non-nil."
\r
124 (insert "Date: " date "\n\n")
\r
126 (insert (with-temp-buffer
\r
127 - ;; Don't attempt to clean up messages, excerpt
\r
128 - ;; citations, etc. in the original message before
\r
130 - (let ((notmuch-show-insert-text/plain-hook nil))
\r
132 + ;; Don't attempt to clean up messages, excerpt
\r
133 + ;; citations, etc. in the original message before
\r
135 + ((notmuch-show-insert-text/plain-hook nil)
\r
136 + ;; Don't omit long parts.
\r
137 + (notmuch-show-max-text-part-size 0)
\r
138 + ;; Insert headers for parts as appropriate for replying.
\r
139 + (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))
\r
140 (notmuch-show-insert-body original (plist-get original :body) 0)
\r
141 (buffer-substring-no-properties (point-min) (point-max)))))
\r
143 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
144 index 5654d11..ec58cac 100644
\r
145 --- a/emacs/notmuch-show.el
\r
146 +++ b/emacs/notmuch-show.el
\r
147 @@ -957,6 +957,19 @@ this part.")
\r
148 (not (and (string= mime-type "text/plain")
\r
149 (<= (plist-get part :id) 1)))))
\r
151 +(defun notmuch-show-reply-insert-header-p-never (part hide)
\r
154 +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)
\r
155 + (let ((mime-type (notmuch-show-mime-type part)))
\r
156 + (and (not (notmuch-match-content-type mime-type "multipart/*"))
\r
159 +(defun notmuch-show-reply-insert-header-p-minimal (part hide)
\r
160 + (let ((mime-type (notmuch-show-mime-type part)))
\r
161 + (and (notmuch-match-content-type mime-type "text/*")
\r
164 (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
\r
165 "Insert the body part PART at depth DEPTH in the current thread.
\r