From 91af76bf30b0acca02fa4320d8d8f7182e57acdc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 30 Apr 2012 15:50:12 +0300 Subject: [PATCH] Resurrect encoding of replies by Rmail which was lost in 2012-04-11T21:37:13Z!monnier@iro.umontreal.ca. lisp/mail/rmail.el (rmail-yank-current-message): Use the encoding of the yanked message in preference to the default value of buffer-file-coding-system. --- lisp/ChangeLog | 6 ++++++ lisp/mail/rmail.el | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eb1f5d22829..ae273d9d610 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-04-30 Eli Zaretskii + + * mail/rmail.el (rmail-yank-current-message): Use the encoding of + the yanked message in preference to the default value of + buffer-file-coding-system. + 2012-04-30 Martin Rudalics * window.el (display-buffer--action-function-custom-type): Fix diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 265347ca69a..d70e578a0fa 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 -- 2.39.5