From: Eli Zaretskii Date: Thu, 10 Dec 1998 13:37:02 +0000 (+0000) Subject: (load-with-code-conversion): If the loaded X-Git-Tag: emacs-20.4~1089 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d2767808eb12de1c63cf58703f02d1bf83ef5c0;p=emacs.git (load-with-code-conversion): If the loaded file was inserted with no-conversion or raw-text coding system, make the buffer unibyte. --- diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 4579399457f..31cb9e46916 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -69,6 +69,14 @@ Return t if file exists." (save-excursion (set-buffer buffer) (insert-file-contents fullname) + ;; If the loaded file was inserted with no-conversion or + ;; raw-text coding system, make the buffer unibyte. + ;; Otherwise, eval-buffer might try to interpret random + ;; binary junk as multibyte characters. + (if (and enable-multibyte-characters + (or (eq (coding-system-type last-coding-system-used) 5) + (eq last-coding-system-used 'no-conversion))) + (set-buffer-multibyte nil)) ;; Make `kill-buffer' quiet. (set-buffer-modified-p nil)) ;; Have the original buffer current while we eval.