]> git.eshelyaron.com Git - emacs.git/commitdiff
(load-with-code-conversion): If the loaded
authorEli Zaretskii <eliz@gnu.org>
Thu, 10 Dec 1998 13:37:02 +0000 (13:37 +0000)
committerEli Zaretskii <eliz@gnu.org>
Thu, 10 Dec 1998 13:37:02 +0000 (13:37 +0000)
file was inserted  with no-conversion or raw-text coding system,
make the buffer unibyte.

lisp/international/mule.el

index 4579399457f54efd9f96bab38ec4cc6aaefea1d4..31cb9e46916a731f9cfe5a51d8de79f54c0f3484 100644 (file)
@@ -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.