# HG changeset patch # User Kenichi Handa # Date 961029141 0 # Node ID 4f79b4ed9ebc3baab94cb336a7df2fb167eafb46 # Parent 7541a7e8924d7dd309de0ce7e1635fa38919de90 (set-buffer-file-coding-system): Almost rewritten to handle `undecided' as no-op. diff -r 7541a7e8924d -r 4f79b4ed9ebc lisp/international/mule.el --- a/lisp/international/mule.el Thu Jun 15 00:31:47 2000 +0000 +++ b/lisp/international/mule.el Thu Jun 15 00:32:21 2000 +0000 @@ -816,14 +816,19 @@ (interactive "zCoding system for visited file (default, nil): \nP") (check-coding-system coding-system) (if (and coding-system buffer-file-coding-system (null force)) - (let ((x (coding-system-eol-type buffer-file-coding-system)) - (y (coding-system-eol-type coding-system))) - (if (and (numberp x) (>= x 0) (<= x 2) (vectorp y)) - (setq coding-system (aref y x)) - (if (and (eq (coding-system-base coding-system) 'undecided) - (numberp y)) - (setq coding-system (coding-system-change-eol-conversion - buffer-file-coding-system y)))))) + (let ((base (coding-system-base buffer-file-coding-system)) + (eol (coding-system-eol-type buffer-file-coding-system))) + ;; If CODING-SYSTEM doesn't specify text conversion, merge + ;; with that of buffer-file-coding-system. + (if (eq (coding-system-base coding-system) 'undecided) + (setq coding-system (coding-system-change-text-conversion + coding-system base))) + ;; If CODING-SYSTEM doesn't specify eol conversion, merge with + ;; that of buffer-file-coding-system. + (if (and (vectorp (coding-system-eol-type coding-system)) + (numberp eol) (>= eol 0) (<= eol 2)) + (setq coding-system (coding-system-change-eol-conversion + coding-system eol))))) (setq buffer-file-coding-system coding-system) (set-buffer-modified-p t) (force-mode-line-update))