From: Kenichi Handa Date: Mon, 30 Oct 2006 07:40:14 +0000 (+0000) Subject: (revert-buffer): If a unibyte buffer is being reverted X-Git-Tag: emacs-pretest-22.0.91~466 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e1ee3b548bd498b8d7dbd251ea98158dbcf481dc;p=emacs.git (revert-buffer): If a unibyte buffer is being reverted with a coding system for multibyte, set buffer multibyte before calling insert-file-contents. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index acb3e5c3a99..ad942083566 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-10-30 Kenichi Handa + + * files.el (revert-buffer): If a unibyte buffer is being reverted + with a coding system for multibyte, set buffer multibyte before + calling insert-file-contents. + 2006-10-30 Stefan Monnier * server.el (server-select-display): Use a dummy buffer to detect when diff --git a/lisp/files.el b/lisp/files.el index 4b746225f60..a78d798f38b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4094,6 +4094,15 @@ non-nil, it is called instead of rereading visited file contents." (if auto-save-p 'auto-save-coding (or coding-system-for-read buffer-file-coding-system-explicit)))) + (if (and (not enable-multibyte-characters) + (not (memq (coding-system-base + coding-system-for-read) + '(no-conversion raw-text)))) + ;; As a coding system suitable for multibyte + ;; buffer is specified, make the current + ;; buffer multibyte. + (set-buffer-multibyte t)) + ;; This force after-insert-file-set-coding ;; (called from insert-file-contents) to set ;; buffer-file-coding-system to a proper value.