summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>1998-12-10 13:37:02 +0000
committerEli Zaretskii <eliz@gnu.org>1998-12-10 13:37:02 +0000
commit7d2767808eb12de1c63cf58703f02d1bf83ef5c0 (patch)
tree1281d793abceca950e9bc3b11e73ac3ce1f65cfa
parentdabe36a823eb54686fa4deea4603088d70fa5b41 (diff)
downloademacs-7d2767808eb12de1c63cf58703f02d1bf83ef5c0.tar.gz
(load-with-code-conversion): If the loaded
file was inserted with no-conversion or raw-text coding system, make the buffer unibyte.
-rw-r--r--lisp/international/mule.el8
1 files changed, 8 insertions, 0 deletions
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.