aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2000-06-10 02:17:40 +0000
committerKenichi Handa2000-06-10 02:17:40 +0000
commitb839fdcc45b28f490171528b9634a205ef0c9366 (patch)
tree18cacb833c1f44566931c12723feb469ffef3bc2
parent8d969bf6151099d06cbf8065abe7a68443d66a43 (diff)
downloademacs-b839fdcc45b28f490171528b9634a205ef0c9366.tar.gz
emacs-b839fdcc45b28f490171528b9634a205ef0c9366.zip
(set-buffer-file-coding-system): If one of undecided-XXX is specified,
change only EOL conversion.
-rw-r--r--lisp/international/mule.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index bd9e75220e6..92c29fc78f1 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -801,8 +801,13 @@ use \\[list-coding-systems].
801If the buffer's previous file coding-system value specifies end-of-line 801If the buffer's previous file coding-system value specifies end-of-line
802conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is 802conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is
803merged with the already-specified end-of-line conversion. 803merged with the already-specified end-of-line conversion.
804However, if the optional prefix argument FORCE is non-nil, 804
805then CODING-SYSTEM is used exactly as specified. 805If the buffer's previous file coding-system value specifies text
806conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is
807merged with the already-specified text conversion.
808
809However, if the optional prefix argument FORCE is non-nil, then
810CODING-SYSTEM is used exactly as specified.
806 811
807This marks the buffer modified so that the succeeding \\[save-buffer] 812This marks the buffer modified so that the succeeding \\[save-buffer]
808surely saves the buffer with CODING-SYSTEM. From a program, if you 813surely saves the buffer with CODING-SYSTEM. From a program, if you
@@ -810,11 +815,15 @@ don't want to mark the buffer modified, just set the variable
810`buffer-file-coding-system' directly." 815`buffer-file-coding-system' directly."
811 (interactive "zCoding system for visited file (default, nil): \nP") 816 (interactive "zCoding system for visited file (default, nil): \nP")
812 (check-coding-system coding-system) 817 (check-coding-system coding-system)
813 (if (null force) 818 (if (and buffer-file-coding-system (null force))
814 (let ((x (coding-system-eol-type buffer-file-coding-system)) 819 (let ((x (coding-system-eol-type buffer-file-coding-system))
815 (y (coding-system-eol-type coding-system))) 820 (y (coding-system-eol-type coding-system)))
816 (if (and (numberp x) (>= x 0) (<= x 2) (vectorp y)) 821 (if (and (numberp x) (>= x 0) (<= x 2) (vectorp y))
817 (setq coding-system (aref y x))))) 822 (setq coding-system (aref y x))
823 (if (and (eq (coding-system-base coding-system) 'undecided)
824 (numberp y))
825 (setq coding-system (coding-system-change-eol-conversion
826 buffer-file-coding-system y))))))
818 (setq buffer-file-coding-system coding-system) 827 (setq buffer-file-coding-system coding-system)
819 (set-buffer-modified-p t) 828 (set-buffer-modified-p t)
820 (force-mode-line-update)) 829 (force-mode-line-update))