changeset 59209:51f8c6bcc746

(basic-save-buffer-1): Set explicit-buffer-file-coding-system to last-coding-system-used. (revert-buffer): Pay attention to explicit-buffer-file-coding-system (not buffer-file-coding-system) on bind coding-system-for-read.
author Kenichi Handa <handa@m17n.org>
date Thu, 30 Dec 2004 12:42:11 +0000
parents 34a8622540ad
children 6e385b257cef
files lisp/files.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Dec 30 12:39:58 2004 +0000
+++ b/lisp/files.el	Thu Dec 30 12:42:11 2004 +0000
@@ -3238,7 +3238,8 @@
   (if save-buffer-coding-system
       (let ((coding-system-for-write save-buffer-coding-system))
 	(basic-save-buffer-2))
-    (basic-save-buffer-2)))
+    (basic-save-buffer-2))
+  (setq explicit-buffer-file-coding-system last-coding-system-used))
 
 ;; This returns a value (MODES . BACKUPNAME), like backup-buffer.
 (defun basic-save-buffer-2 ()
@@ -3708,11 +3709,11 @@
 			 (unlock-buffer)))
 		   (widen)
 		   (let ((coding-system-for-read
-			  ;; Auto-saved file shoule be read without
-			  ;; any code conversion.
-			  (if auto-save-p 'emacs-mule-unix
+			  ;; Auto-saved file shoule be read by Emacs'
+			  ;; internal coding.
+			  (if auto-save-p 'auto-save-coding
 			    (or coding-system-for-read
-				buffer-file-coding-system))))
+				explicit-buffer-file-coding-system))))
 		     ;; This force after-insert-file-set-coding
 		     ;; (called from insert-file-contents) to set
 		     ;; buffer-file-coding-system to a proper value.