Changeset 4131 for trunk/lisp/international/mule-cmds.el
- Timestamp:
- 2006年07月29日 07時48分34秒 (2 years ago)
- Files:
-
- trunk/lisp/international/mule-cmds.el (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/international/mule-cmds.el
r4111 r4131 832 832 list of coding systems to be prepended to the default coding system 833 833 list. However, if DEFAULT-CODING-SYSTEM is a list and the first 834 element is t, the cdr part is used as the def ualt coding system list,834 element is t, the cdr part is used as the default coding system list, 835 835 i.e. `buffer-file-coding-system', `default-buffer-file-coding-system', 836 836 and the most preferred coding system are not used. … … 899 899 (push (cons auto-cs base) default-coding-system)))) 900 900 901 ;; From now on, the list of defaults is reversed.902 (setq default-coding-system (nreverse default-coding-system))903 904 901 (unless no-other-defaults 905 902 ;; If buffer-file-coding-system is not nil nor undecided, append it … … 909 906 (or (eq base 'undecided) 910 907 (rassq base default-coding-system) 911 (push (cons buffer-file-coding-system base) 912 default-coding-system)))) 908 (setq default-coding-system 909 (append default-coding-system 910 (list (cons buffer-file-coding-system base))))))) 913 911 914 912 ;; If default-buffer-file-coding-system is not nil nor undecided, … … 918 916 (or (eq base 'undecided) 919 917 (rassq base default-coding-system) 920 (push (cons default-buffer-file-coding-system base) 921 default-coding-system)))) 918 (setq default-coding-system 919 (append default-coding-system 920 (list (cons default-buffer-file-coding-system 921 base))))))) 922 922 923 923 ;; If the most preferred coding system has the property mime-charset, … … 931 931 (coding-system-get preferred 'mime-charset) 932 932 (not (rassq base default-coding-system)) 933 (push (cons preferred base) 934 default-coding-system)))) 933 (setq default-coding-system 934 (append default-coding-system 935 (list (cons preferred base))))))) 935 936 936 937 (if select-safe-coding-system-accept-default-p 937 938 (setq accept-default-p select-safe-coding-system-accept-default-p)) 939 940 ;; Decide the eol-type from the top of the default codings, 941 ;; buffer-file-coding-system, or 942 ;; default-buffer-file-coding-system. 943 (if default-coding-system 944 (let ((default-eol-type (coding-system-eol-type 945 (caar default-coding-system)))) 946 (if (and (vectorp default-eol-type) buffer-file-coding-system) 947 (setq default-eol-type (coding-system-eol-type 948 buffer-file-coding-system))) 949 (if (and (vectorp default-eol-type) default-buffer-file-coding-system) 950 (setq default-eol-type (coding-system-eol-type 951 default-buffer-file-coding-system))) 952 (if (and default-eol-type (not (vectorp default-eol-type))) 953 (dolist (elt default-coding-system) 954 (setcar elt (coding-system-change-eol-conversion 955 (car elt) default-eol-type)))))) 938 956 939 957 (let ((codings (find-coding-systems-region from to)) … … 942 960 (if (eq (car codings) 'undecided) 943 961 ;; Any coding system is ok. 944 (setq coding-system t) 962 (setq coding-system (caar default-coding-system)) 963 ;; Reverse the list so that elements are accumulated in safe, 964 ;; rejected, and unsafe in the correct order. 965 (setq default-coding-system (nreverse default-coding-system)) 966 945 967 ;; Classify the defaults into safe, rejected, and unsafe. 946 968 (dolist (elt default-coding-system) … … 959 981 from to codings unsafe rejected (car codings)))) 960 982 961 (if (vectorp (coding-system-eol-type coding-system))962 (let ((eol (coding-system-eol-type buffer-file-coding-system)))963 (if (numberp eol)964 (setq coding-system965 (coding-system-change-eol-conversion coding-system eol)))))966 967 (if (eq coding-system t)968 (setq coding-system buffer-file-coding-system))969 983 ;; Check we're not inconsistent with what `coding:' spec &c would 970 984 ;; give when file is re-read.
