From b77d82114f8c572900b92719d56048f09a160f7a Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 26 Aug 1997 11:45:49 +0000 Subject: [PATCH] (revert-buffer): Read a file without any code conversion if we are reverting from an auto-saved file. --- lisp/files.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 3d264a3ddd5..2cbce768aad 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2524,8 +2524,13 @@ non-nil, it is called instead of rereading visited file contents." (or auto-save-p (unlock-buffer))) (widen) - (insert-file-contents file-name (not auto-save-p) - nil nil t))) + (let ((coding-system-for-read + ;; Auto-saved file shoule be read without + ;; any code conversion. + (if auto-save-p 'no-conversion + coding-system-for-read))) + (insert-file-contents file-name (not auto-save-p) + nil nil t)))) (goto-char (min opoint (point-max))) ;; Recompute the truename in case changes in symlinks ;; have changed the truename. -- 2.39.2