1 Return-Path: <awg@lagos.xvx.ca>
\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 46518431FC0
\r
6 for <notmuch@notmuchmail.org>; Sat, 21 Apr 2012 17:55:07 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 Ig1ZCXn0vodQ for <notmuch@notmuchmail.org>;
\r
16 Sat, 21 Apr 2012 17:54:56 -0700 (PDT)
\r
17 Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 4B3B3431FAE
\r
19 for <notmuch@notmuchmail.org>; Sat, 21 Apr 2012 17:54:56 -0700 (PDT)
\r
20 Received: from lb7f8hsrpno-svcs.dcs.int.inet (HELO pd7ml2no-ssvc.prod.shaw.ca)
\r
22 by pd7mo1no-svcs.prod.shaw.ca with ESMTP; 21 Apr 2012 18:54:55 -0600
\r
23 X-Cloudmark-SP-Filtered: true
\r
24 X-Cloudmark-SP-Result: v=1.1 cv=GZn8e3lTBEeJrlGK3+GUWyR5aYe1SJcDn5uEERMe9yQ=
\r
26 a=B06ZCV3J_Z4A:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17
\r
27 a=m7wnEdaWTtPIwypKjJwA:9 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
\r
28 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])
\r
29 by pd7ml2no-dmz.prod.shaw.ca with ESMTP; 21 Apr 2012 18:54:55 -0600
\r
30 Received: by lagos.xvx.ca (Postfix, from userid 1000)
\r
31 id EEBB48004814; Sat, 21 Apr 2012 18:54:54 -0600 (MDT)
\r
32 From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>
\r
33 To: notmuch@notmuchmail.org
\r
34 Subject: [PATCH 2/2] emacs: Correctly quote non-text/plain parts in reply
\r
35 Date: Sat, 21 Apr 2012 18:54:53 -0600
\r
36 Message-Id: <1335056093-17621-3-git-send-email-awg+notmuch@xvx.ca>
\r
37 X-Mailer: git-send-email 1.7.5.4
\r
38 In-Reply-To: <1335056093-17621-1-git-send-email-awg+notmuch@xvx.ca>
\r
39 References: <1335056093-17621-1-git-send-email-awg+notmuch@xvx.ca>
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Sun, 22 Apr 2012 00:55:07 -0000
\r
54 Quote non-text parts nicely by displaying them with mm-display-part
\r
55 before calling message-cite-original to quote them. HTML-only emails
\r
56 can now be quoted correctly.
\r
58 Mark the test for this feature as not broken.
\r
60 emacs/notmuch-mua.el | 20 +++++++++++++++-----
\r
62 2 files changed, 15 insertions(+), 6 deletions(-)
\r
64 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
\r
65 index 87bd88d..f7af789 100644
\r
66 --- a/emacs/notmuch-mua.el
\r
67 +++ b/emacs/notmuch-mua.el
\r
73 (require 'format-spec)
\r
75 (require 'notmuch-lib)
\r
76 @@ -90,6 +91,19 @@ list."
\r
77 else if (notmuch-match-content-type (plist-get part :content-type) "text/*")
\r
80 +(defun notmuch-mua-insert-quotable-part (message part)
\r
82 + (narrow-to-region (point) (point))
\r
83 + (insert (notmuch-get-bodypart-content message part
\r
84 + (plist-get part :id)
\r
85 + notmuch-show-process-crypto))
\r
86 + (let ((handle (mm-make-handle (current-buffer)
\r
87 + (list (plist-get part :content-type))))
\r
88 + (end-of-orig (point-max)))
\r
89 + (mm-display-part handle)
\r
90 + (kill-region (point-min) end-of-orig))
\r
91 + (goto-char (point-max))))
\r
93 ;; There is a bug in emacs 23's message.el that results in a newline
\r
94 ;; not being inserted after the References header, so the next header
\r
95 ;; is concatenated to the end of it. This function fixes the problem,
\r
96 @@ -169,11 +183,7 @@ list."
\r
97 ;; Get the parts of the original message that should be quoted; this includes
\r
98 ;; all the text parts, except the non-preferred ones in a multipart/alternative.
\r
99 (let ((quotable-parts (notmuch-mua-get-quotable-parts (plist-get original :body))))
\r
100 - (mapc (lambda (part)
\r
101 - (insert (notmuch-get-bodypart-content original part
\r
102 - (plist-get part :id)
\r
103 - notmuch-show-process-crypto)))
\r
105 + (mapc (apply-partially 'notmuch-mua-insert-quotable-part original) quotable-parts))
\r
109 diff --git a/test/emacs b/test/emacs
\r
110 index e648f80..579844f 100755
\r
113 @@ -445,7 +445,6 @@ EOF
\r
114 test_expect_equal_file OUTPUT EXPECTED
\r
116 test_begin_subtest "Reply within emacs to an html-only message"
\r
117 -test_subtest_known_broken
\r
118 add_message '[content-type]="text/html"' \
\r
119 '[body]="Hi,<br />This is an <b>HTML</b> test message.<br /><br />OK?"'
\r
120 test_emacs "(let ((message-hidden-headers '()))
\r