aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2000-06-15 00:32:21 +0000
committerKenichi Handa2000-06-15 00:32:21 +0000
commit8dd735c19afc005afc439baed3daa5d636368324 (patch)
tree58db86cb673348c340162068eec9046c9feb65aa
parent32684631da50fc079bc3681e374a7dddffcb71a3 (diff)
downloademacs-8dd735c19afc005afc439baed3daa5d636368324.tar.gz
emacs-8dd735c19afc005afc439baed3daa5d636368324.zip
(set-buffer-file-coding-system): Almost rewritten to handle
`undecided' as no-op.
-rw-r--r--lisp/international/mule.el21
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index e968ad0873f..1c0d6ac5fa2 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -816,14 +816,19 @@ don't want to mark the buffer modified, just set the variable
816 (interactive "zCoding system for visited file (default, nil): \nP") 816 (interactive "zCoding system for visited file (default, nil): \nP")
817 (check-coding-system coding-system) 817 (check-coding-system coding-system)
818 (if (and coding-system buffer-file-coding-system (null force)) 818 (if (and coding-system buffer-file-coding-system (null force))
819 (let ((x (coding-system-eol-type buffer-file-coding-system)) 819 (let ((base (coding-system-base buffer-file-coding-system))
820 (y (coding-system-eol-type coding-system))) 820 (eol (coding-system-eol-type buffer-file-coding-system)))
821 (if (and (numberp x) (>= x 0) (<= x 2) (vectorp y)) 821 ;; If CODING-SYSTEM doesn't specify text conversion, merge
822 (setq coding-system (aref y x)) 822 ;; with that of buffer-file-coding-system.
823 (if (and (eq (coding-system-base coding-system) 'undecided) 823 (if (eq (coding-system-base coding-system) 'undecided)
824 (numberp y)) 824 (setq coding-system (coding-system-change-text-conversion
825 (setq coding-system (coding-system-change-eol-conversion 825 coding-system base)))
826 buffer-file-coding-system y)))))) 826 ;; If CODING-SYSTEM doesn't specify eol conversion, merge with
827 ;; that of buffer-file-coding-system.
828 (if (and (vectorp (coding-system-eol-type coding-system))
829 (numberp eol) (>= eol 0) (<= eol 2))
830 (setq coding-system (coding-system-change-eol-conversion
831 coding-system eol)))))
827 (setq buffer-file-coding-system coding-system) 832 (setq buffer-file-coding-system coding-system)
828 (set-buffer-modified-p t) 833 (set-buffer-modified-p t)
829 (force-mode-line-update)) 834 (force-mode-line-update))