]> git.eshelyaron.com Git - emacs.git/commitdiff
(recover-file): Recover buffer-file-coding-system.
authorKenichi Handa <handa@m17n.org>
Mon, 24 May 1999 02:09:27 +0000 (02:09 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 24 May 1999 02:09:27 +0000 (02:09 +0000)
lisp/files.el

index 6d3509acf154964a7281320df9b6324e2ec6e4d1..2424931183655740577468d2da1d18e2048bdc39 100644 (file)
@@ -2807,10 +2807,13 @@ non-nil, it is called instead of rereading visited file contents."
             (yes-or-no-p (format "Recover auto save file %s? " file-name)))
           (switch-to-buffer (find-file-noselect file t))
           (let ((buffer-read-only nil)
+                ;; Keep the current buffer-file-coding-system.
+                (coding-system buffer-file-coding-system)
                 ;; Auto-saved file shoule be read without any code conversion.
                 (coding-system-for-read 'no-conversion))
             (erase-buffer)
-            (insert-file-contents file-name nil))
+            (insert-file-contents file-name nil)
+            (set-buffer-file-coding-system coding-system))
           (after-find-file nil nil t))
          (t (error "Recover-file cancelled")))))