comparison lisp/international/mule.el @ 29544:6f22d585904b

(set-buffer-file-coding-system): If one of undecided-XXX is specified, change only EOL conversion.
author Kenichi Handa <handa@m17n.org>
date Sat, 10 Jun 2000 02:17:40 +0000
parents 09063dfdc92c
children ab979e3b519a
comparison
equal deleted inserted replaced
29543:4711a63436ee 29544:6f22d585904b
799 use \\[list-coding-systems]. 799 use \\[list-coding-systems].
800 800
801 If the buffer's previous file coding-system value specifies end-of-line 801 If the buffer's previous file coding-system value specifies end-of-line
802 conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is 802 conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is
803 merged with the already-specified end-of-line conversion. 803 merged with the already-specified end-of-line conversion.
804 However, if the optional prefix argument FORCE is non-nil, 804
805 then CODING-SYSTEM is used exactly as specified. 805 If the buffer's previous file coding-system value specifies text
806 conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is
807 merged with the already-specified text conversion.
808
809 However, if the optional prefix argument FORCE is non-nil, then
810 CODING-SYSTEM is used exactly as specified.
806 811
807 This marks the buffer modified so that the succeeding \\[save-buffer] 812 This marks the buffer modified so that the succeeding \\[save-buffer]
808 surely saves the buffer with CODING-SYSTEM. From a program, if you 813 surely saves the buffer with CODING-SYSTEM. From a program, if you
809 don't want to mark the buffer modified, just set the variable 814 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))
821 830
822 (defvar default-terminal-coding-system nil 831 (defvar default-terminal-coding-system nil