From: Kenichi Handa Date: Mon, 24 May 1999 02:09:27 +0000 (+0000) Subject: (recover-file): Recover buffer-file-coding-system. X-Git-Tag: emacs-20.4~185 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1e87edf5efd0e14403b9a778a0bbdc55cc1efb16;p=emacs.git (recover-file): Recover buffer-file-coding-system. --- diff --git a/lisp/files.el b/lisp/files.el index 6d3509acf15..24249311836 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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")))))