diff options
| author | Kenichi Handa | 1999-05-24 02:09:27 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-05-24 02:09:27 +0000 |
| commit | 1e87edf5efd0e14403b9a778a0bbdc55cc1efb16 (patch) | |
| tree | a9895b62e61684e76fc02d160d07a2aa95d06e4e | |
| parent | 596ff2eefcb37c68d633ed5a69c2fac5012e9f22 (diff) | |
| download | emacs-1e87edf5efd0e14403b9a778a0bbdc55cc1efb16.tar.gz emacs-1e87edf5efd0e14403b9a778a0bbdc55cc1efb16.zip | |
(recover-file): Recover buffer-file-coding-system.
| -rw-r--r-- | lisp/files.el | 5 |
1 files changed, 4 insertions, 1 deletions
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." | |||
| 2807 | (yes-or-no-p (format "Recover auto save file %s? " file-name))) | 2807 | (yes-or-no-p (format "Recover auto save file %s? " file-name))) |
| 2808 | (switch-to-buffer (find-file-noselect file t)) | 2808 | (switch-to-buffer (find-file-noselect file t)) |
| 2809 | (let ((buffer-read-only nil) | 2809 | (let ((buffer-read-only nil) |
| 2810 | ;; Keep the current buffer-file-coding-system. | ||
| 2811 | (coding-system buffer-file-coding-system) | ||
| 2810 | ;; Auto-saved file shoule be read without any code conversion. | 2812 | ;; Auto-saved file shoule be read without any code conversion. |
| 2811 | (coding-system-for-read 'no-conversion)) | 2813 | (coding-system-for-read 'no-conversion)) |
| 2812 | (erase-buffer) | 2814 | (erase-buffer) |
| 2813 | (insert-file-contents file-name nil)) | 2815 | (insert-file-contents file-name nil) |
| 2816 | (set-buffer-file-coding-system coding-system)) | ||
| 2814 | (after-find-file nil nil t)) | 2817 | (after-find-file nil nil t)) |
| 2815 | (t (error "Recover-file cancelled"))))) | 2818 | (t (error "Recover-file cancelled"))))) |
| 2816 | 2819 | ||