Mercurial > emacs
comparison lisp/files.el @ 24764:ece1961bd955
(recover-file): Recover buffer-file-coding-system.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 24 May 1999 02:09:27 +0000 |
parents | 358a330c9931 |
children | b772f629b45b |
comparison
equal
deleted
inserted
replaced
24763:c9362ef0817a | 24764:ece1961bd955 |
---|---|
2805 (if (file-symlink-p file) "-lL" "-l") | 2805 (if (file-symlink-p file) "-lL" "-l") |
2806 file file-name))) | 2806 file file-name))) |
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 |
2817 (defun recover-session () | 2820 (defun recover-session () |
2818 "Recover auto save files from a previous Emacs session. | 2821 "Recover auto save files from a previous Emacs session. |