]> git.eshelyaron.com Git - emacs.git/commitdiff
Resurrect encoding of replies by Rmail which was lost in 2012-04-11T21:37:13Z!monnier...
authorEli Zaretskii <eliz@gnu.org>
Mon, 30 Apr 2012 12:50:12 +0000 (15:50 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 30 Apr 2012 12:50:12 +0000 (15:50 +0300)
 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
lisp/mail/rmail.el

index eb1f5d228296503962badafe1723db9e3a57e780..ae273d9d6108e5a7c7e8d3fce17140793d2d31a7 100644 (file)
@@ -1,3 +1,9 @@
+2012-04-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <rudalics@gmx.at>
 
        * window.el (display-buffer--action-function-custom-type): Fix
index 265347ca69a8d163a791ead0fc5ae536e2bab5b8..d70e578a0fa04392e45ef20623a275226d000beb 100644 (file)
@@ -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