From 84c9d21596fcb8676584a19bac632404419f7303 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Mon, 2 Mar 1998 20:01:46 +0000 Subject: [PATCH] (load-with-code-conversion): Don't bind enable-multibyte-characters; instead, bind default-enable-multibyte-characters before creating buffer. (after-insert-file-set-buffer-file-coding-system): Use set-buffer-multibyte. Use add-hook to add this to after-insert-file-functions. --- lisp/international/mule.el | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index f93484f0ca8..5c4e14c0082 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -45,7 +45,8 @@ Return t if file exists." (let* ((buffer ;; To avoid any autoloading, set default-major-mode to ;; fundamental-mode. - (let ((default-major-mode 'fundamental-mode)) + (let ((default-major-mode 'fundamental-mode) + (default-enable-multibyte-characters t)) ;; We can't use `generate-new-buffer' because files.el ;; is not yet loaded. (get-buffer-create (generate-new-buffer-name " *load*")))) @@ -62,8 +63,6 @@ Return t if file exists." (inhibit-file-name-operation nil)) (save-excursion (set-buffer buffer) - ;; This is buffer-local. - (setq enable-multibyte-characters t) (insert-file-contents fullname) ;; Make `kill-buffer' quiet. (set-buffer-modified-p nil)) @@ -827,15 +826,13 @@ function by default." (if (or (eq coding-system 'no-conversion) (eq (coding-system-type coding-system) 5)) ;; It seems that random 8-bit codes are read. We had - ;; better edit this buffer without multibyte character - ;; facility. + ;; better edit this buffer without multibyte characters. (set-buffer-multibyte nil)) (set-buffer-modified-p modified-p)))) nil) -(setq after-insert-file-functions - (cons 'after-insert-file-set-buffer-file-coding-system - after-insert-file-functions)) +(add-hook 'after-insert-file-functions + 'after-insert-file-set-buffer-file-coding-system) ;; The coding-spec and eol-type of coding-system returned is decided ;; independently in the following order. -- 2.39.2