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 37C2C431FAF
\r
6 for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 01:10:43 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 uQpihxlSZPYD for <notmuch@notmuchmail.org>;
\r
17 Sun, 22 Apr 2012 01:10:42 -0700 (PDT)
\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 511EF431FAE
\r
22 for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 01:10:42 -0700 (PDT)
\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 1SLrsW-0002Jf-GX; Sun, 22 Apr 2012 09:10:40 +0100
\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]
\r
29 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)
\r
30 (envelope-from <m.walters@qmul.ac.uk>)
\r
31 id 1SLrsW-0000RR-5S; Sun, 22 Apr 2012 09:10:40 +0100
\r
32 From: Mark Walters <markwalters1009@gmail.com>
\r
33 To: Adam Wolfe Gordon <awg+notmuch@xvx.ca>, notmuch@notmuchmail.org
\r
34 Subject: Re: [PATCH 2/2] emacs: Correctly quote non-text/plain parts in reply
\r
35 In-Reply-To: <1335056093-17621-3-git-send-email-awg+notmuch@xvx.ca>
\r
36 References: <1335056093-17621-1-git-send-email-awg+notmuch@xvx.ca>
\r
37 <1335056093-17621-3-git-send-email-awg+notmuch@xvx.ca>
\r
38 User-Agent: Notmuch/0.12+110~gbc97b4a (http://notmuchmail.org) Emacs/23.3.1
\r
39 (x86_64-pc-linux-gnu)
\r
40 Date: Sun, 22 Apr 2012 09:10:59 +0100
\r
41 Message-ID: <87hawcuqy4.fsf@qmul.ac.uk>
\r
43 Content-Type: text/plain; charset=us-ascii
\r
44 X-Sender-Host-Address: 94.192.233.223
\r
45 X-QM-SPAM-Info: Sender has good ham record. :)
\r
46 X-QM-Body-MD5: a7785dd892df14389f9af2d32dbb5335 (of first 20000 bytes)
\r
47 X-SpamAssassin-Score: -1.8
\r
48 X-SpamAssassin-SpamBar: -
\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
51 spam. We require at least 5.0 points to mark a message as spam.
\r
52 This message scored -1.8 points.
\r
53 Summary of the scoring:
\r
54 * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,
\r
56 * [138.37.6.40 listed in list.dnswl.org]
\r
57 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
58 provider * (markwalters1009[at]gmail.com)
\r
59 * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
\r
61 * 0.5 AWL AWL: From: address is in the auto white-list
\r
62 X-QM-Scan-Virus: ClamAV says the message is clean
\r
63 X-BeenThere: notmuch@notmuchmail.org
\r
64 X-Mailman-Version: 2.1.13
\r
66 List-Id: "Use and development of the notmuch mail system."
\r
67 <notmuch.notmuchmail.org>
\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
71 List-Post: <mailto:notmuch@notmuchmail.org>
\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
74 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
75 X-List-Received-Date: Sun, 22 Apr 2012 08:10:43 -0000
\r
77 On Sun, 22 Apr 2012, Adam Wolfe Gordon <awg+notmuch@xvx.ca> wrote:
\r
78 > Quote non-text parts nicely by displaying them with mm-display-part
\r
79 > before calling message-cite-original to quote them. HTML-only emails
\r
80 > can now be quoted correctly.
\r
82 My instinct would have been to do this with a temporary buffer rather
\r
83 than the narrowing but I am *definitely* too much of a lisp beginner to
\r
84 say that either is better.
\r
86 (I think notmuch-show-mm-display-part-inline uses the temporary buffer
\r
89 Anyway, as it is, it looks correct and seems to work! (and is obviously
\r
90 useful functionality)
\r
96 > Mark the test for this feature as not broken.
\r
98 > emacs/notmuch-mua.el | 20 +++++++++++++++-----
\r
100 > 2 files changed, 15 insertions(+), 6 deletions(-)
\r
102 > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
\r
103 > index 87bd88d..f7af789 100644
\r
104 > --- a/emacs/notmuch-mua.el
\r
105 > +++ b/emacs/notmuch-mua.el
\r
106 > @@ -21,6 +21,7 @@
\r
109 > (require 'message)
\r
110 > +(require 'mm-view)
\r
111 > (require 'format-spec)
\r
113 > (require 'notmuch-lib)
\r
114 > @@ -90,6 +91,19 @@ list."
\r
115 > else if (notmuch-match-content-type (plist-get part :content-type) "text/*")
\r
118 > +(defun notmuch-mua-insert-quotable-part (message part)
\r
119 > + (save-restriction
\r
120 > + (narrow-to-region (point) (point))
\r
121 > + (insert (notmuch-get-bodypart-content message part
\r
122 > + (plist-get part :id)
\r
123 > + notmuch-show-process-crypto))
\r
124 > + (let ((handle (mm-make-handle (current-buffer)
\r
125 > + (list (plist-get part :content-type))))
\r
126 > + (end-of-orig (point-max)))
\r
127 > + (mm-display-part handle)
\r
128 > + (kill-region (point-min) end-of-orig))
\r
129 > + (goto-char (point-max))))
\r
131 > ;; There is a bug in emacs 23's message.el that results in a newline
\r
132 > ;; not being inserted after the References header, so the next header
\r
133 > ;; is concatenated to the end of it. This function fixes the problem,
\r
134 > @@ -169,11 +183,7 @@ list."
\r
135 > ;; Get the parts of the original message that should be quoted; this includes
\r
136 > ;; all the text parts, except the non-preferred ones in a multipart/alternative.
\r
137 > (let ((quotable-parts (notmuch-mua-get-quotable-parts (plist-get original :body))))
\r
138 > - (mapc (lambda (part)
\r
139 > - (insert (notmuch-get-bodypart-content original part
\r
140 > - (plist-get part :id)
\r
141 > - notmuch-show-process-crypto)))
\r
142 > - quotable-parts))
\r
143 > + (mapc (apply-partially 'notmuch-mua-insert-quotable-part original) quotable-parts))
\r
145 > (set-mark (point))
\r
146 > (goto-char start)
\r
147 > diff --git a/test/emacs b/test/emacs
\r
148 > index e648f80..579844f 100755
\r
151 > @@ -445,7 +445,6 @@ EOF
\r
152 > test_expect_equal_file OUTPUT EXPECTED
\r
154 > test_begin_subtest "Reply within emacs to an html-only message"
\r
155 > -test_subtest_known_broken
\r
156 > add_message '[content-type]="text/html"' \
\r
157 > '[body]="Hi,<br />This is an <b>HTML</b> test message.<br /><br />OK?"'
\r
158 > test_emacs "(let ((message-hidden-headers '()))
\r
162 > _______________________________________________
\r
163 > notmuch mailing list
\r
164 > notmuch@notmuchmail.org
\r
165 > http://notmuchmail.org/mailman/listinfo/notmuch
\r