diff options
| author | Kenichi Handa | 2004-12-30 12:42:11 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-12-30 12:42:11 +0000 |
| commit | 004f48da21e0158d1623f7d3bc7a3cf69696884e (patch) | |
| tree | 681d5f154207946fbabb09884a6b42e44f6f6e5e | |
| parent | 0436cc1b60b6120208af957416cc92e8ba1665eb (diff) | |
| download | emacs-004f48da21e0158d1623f7d3bc7a3cf69696884e.tar.gz emacs-004f48da21e0158d1623f7d3bc7a3cf69696884e.zip | |
(basic-save-buffer-1): Set
explicit-buffer-file-coding-system to last-coding-system-used.
(revert-buffer): Pay attention to
explicit-buffer-file-coding-system (not buffer-file-coding-system)
on bind coding-system-for-read.
| -rw-r--r-- | lisp/files.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el index 441a230163e..602a79e2f0b 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3238,7 +3238,8 @@ Before and after saving the buffer, this function runs | |||
| 3238 | (if save-buffer-coding-system | 3238 | (if save-buffer-coding-system |
| 3239 | (let ((coding-system-for-write save-buffer-coding-system)) | 3239 | (let ((coding-system-for-write save-buffer-coding-system)) |
| 3240 | (basic-save-buffer-2)) | 3240 | (basic-save-buffer-2)) |
| 3241 | (basic-save-buffer-2))) | 3241 | (basic-save-buffer-2)) |
| 3242 | (setq explicit-buffer-file-coding-system last-coding-system-used)) | ||
| 3242 | 3243 | ||
| 3243 | ;; This returns a value (MODES . BACKUPNAME), like backup-buffer. | 3244 | ;; This returns a value (MODES . BACKUPNAME), like backup-buffer. |
| 3244 | (defun basic-save-buffer-2 () | 3245 | (defun basic-save-buffer-2 () |
| @@ -3708,11 +3709,11 @@ non-nil, it is called instead of rereading visited file contents." | |||
| 3708 | (unlock-buffer))) | 3709 | (unlock-buffer))) |
| 3709 | (widen) | 3710 | (widen) |
| 3710 | (let ((coding-system-for-read | 3711 | (let ((coding-system-for-read |
| 3711 | ;; Auto-saved file shoule be read without | 3712 | ;; Auto-saved file shoule be read by Emacs' |
| 3712 | ;; any code conversion. | 3713 | ;; internal coding. |
| 3713 | (if auto-save-p 'emacs-mule-unix | 3714 | (if auto-save-p 'auto-save-coding |
| 3714 | (or coding-system-for-read | 3715 | (or coding-system-for-read |
| 3715 | buffer-file-coding-system)))) | 3716 | explicit-buffer-file-coding-system)))) |
| 3716 | ;; This force after-insert-file-set-coding | 3717 | ;; This force after-insert-file-set-coding |
| 3717 | ;; (called from insert-file-contents) to set | 3718 | ;; (called from insert-file-contents) to set |
| 3718 | ;; buffer-file-coding-system to a proper value. | 3719 | ;; buffer-file-coding-system to a proper value. |