aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mail
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/rmail.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 265347ca69..d70e578a0f 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3567,8 +3567,17 @@ If BUFFER is not swapped, yank out of its message viewer buffer."
(with-current-buffer buffer
(unless (rmail-buffers-swapped-p)
(setq buffer rmail-view-buffer)))
- (insert-buffer buffer))
-
+ (insert-buffer buffer)
+ ;; If they yank the text of BUFFER, the encoding of BUFFER is a
+ ;; better default for the reply message than the default value of
+ ;; buffer-file-coding-system.
+ (and (coding-system-equal (default-value 'buffer-file-coding-system)
+ buffer-file-coding-system)
+ (setq buffer-file-coding-system
+ (coding-system-change-text-conversion
+ buffer-file-coding-system (coding-system-base
+ (with-current-buffer buffer
+ buffer-file-coding-system))))))
(defun rmail-start-mail (&optional noerase to subject in-reply-to cc
replybuffer sendactions same-window