aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-mua.el
diff options
context:
space:
mode:
authorGravatar Adam Wolfe Gordon <awg+notmuch@xvx.ca>2012-05-05 13:30:37 -0600
committerGravatar David Bremner <bremner@debian.org>2012-05-06 08:48:11 -0300
commitf6c170fabca8f39e74705e3813504137811bf162 (patch)
tree9f3d4875f44a5c2732ab7e47512799cf92473f2a /emacs/notmuch-mua.el
parent7fb8ab9f0b470dc236c92686ed33f8e0fa1d5727 (diff)
emacs: Correctly quote non-text/plain parts in reply
Quote non-text parts nicely by displaying them with mm-display-part before calling message-cite-original to quote them. HTML-only emails can now be quoted correctly. We re-use some code from notmuch-show (notmuch-show-mm-display-part-inline), which has been moved to notmuch-lib.el. Mark the test for this feature as not broken.
Diffstat (limited to 'emacs/notmuch-mua.el')
-rw-r--r--emacs/notmuch-mua.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 87bd88d3..fc7ae073 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -21,6 +21,7 @@
(require 'json)
(require 'message)
+(require 'mm-view)
(require 'format-spec)
(require 'notmuch-lib)
@@ -90,6 +91,14 @@ list."
else if (notmuch-match-content-type (plist-get part :content-type) "text/*")
collect part))
+(defun notmuch-mua-insert-quotable-part (message part)
+ (save-restriction
+ (narrow-to-region (point) (point))
+ (notmuch-mm-display-part-inline message part (plist-get part :id)
+ (plist-get part :content-type)
+ notmuch-show-process-crypto)
+ (goto-char (point-max))))
+
;; There is a bug in emacs 23's message.el that results in a newline
;; not being inserted after the References header, so the next header
;; is concatenated to the end of it. This function fixes the problem,
@@ -169,11 +178,7 @@ list."
;; Get the parts of the original message that should be quoted; this includes
;; all the text parts, except the non-preferred ones in a multipart/alternative.
(let ((quotable-parts (notmuch-mua-get-quotable-parts (plist-get original :body))))
- (mapc (lambda (part)
- (insert (notmuch-get-bodypart-content original part
- (plist-get part :id)
- notmuch-show-process-crypto)))
- quotable-parts))
+ (mapc (apply-partially 'notmuch-mua-insert-quotable-part original) quotable-parts))
(set-mark (point))
(goto-char start)