comparison lisp/mule/mule-cmds.el @ 448:3078fd1074e8 r21-2-39

Import from CVS: tag r21-2-39
author cvs
date Mon, 13 Aug 2007 11:38:25 +0200
parents 576fb035e263
children 7039e6323819
comparison
equal deleted inserted replaced
447:4fc5f13f3bd3 448:3078fd1074e8
687 687
688 The order of priorities of coding categories and the coding system 688 The order of priorities of coding categories and the coding system
689 bound to each category are as follows 689 bound to each category are as follows
690 coding category coding system 690 coding category coding system
691 -------------------------------------------------- 691 --------------------------------------------------
692 iso-8-2 iso-8859-1 692 iso-7 iso-2022-7bit
693 no-conversion raw-text
694 utf-8 utf-8
693 iso-8-1 iso-8859-1 695 iso-8-1 iso-8859-1
694 iso-7 iso-2022-7bit 696 iso-8-2 ctext (iso-8859-1 alias)
697 iso-8-designate ctext (iso-8859-1 alias)
695 iso-lock-shift iso-2022-lock 698 iso-lock-shift iso-2022-lock
696 iso-8-designate iso-2022-8bit-ss2
697 no-conversion raw-text
698 shift-jis shift_jis 699 shift-jis shift_jis
699 big5 big5 700 big5 big5
700 ucs-4 ---- 701 ucs-4 iso-10646-ucs-4
701 utf-8 ----
702 " 702 "
703 ;; The old table (from FSF synch?) was not what we use (cf mule-coding.el),
704 ;; and as documented iso-8-designate is inconsistent with iso-2022-8bit-ss2.
705 ;; The order of priorities of coding categories and the coding system
706 ;; bound to each category are as follows
707 ;; coding category coding system
708 ;; --------------------------------------------------
709 ;; iso-8-2 iso-8859-1
710 ;; iso-8-1 iso-8859-1
711 ;; iso-7 iso-2022-7bit
712 ;; iso-lock-shift iso-2022-lock
713 ;; iso-8-designate iso-2022-8bit-ss2
714 ;; no-conversion raw-text
715 ;; shift-jis shift_jis
716 ;; big5 big5
717 ;; ucs-4 ----
718 ;; utf-8 ----
703 (interactive) 719 (interactive)
704 ;; This function formerly set default-enable-multibyte-characters to t, 720
705 ;; but that is incorrect. It should not alter the unibyte/multibyte choice. 721 (set-coding-category-system 'iso-7 'iso-2022-7)
706
707 (set-coding-category-system 'iso-7 'iso-2022-7bit)
708 (set-coding-category-system 'iso-8-1 'iso-8859-1) 722 (set-coding-category-system 'iso-8-1 'iso-8859-1)
709 (set-coding-category-system 'iso-8-2 'iso-8859-1) 723 (set-coding-category-system 'iso-8-2 'ctext)
710 (set-coding-category-system 'iso-lock-shift 'iso-2022-lock) 724 (set-coding-category-system 'iso-lock-shift 'iso-2022-lock)
711 (set-coding-category-system 'iso-8-designate 'iso-2022-8bit-ss2) 725 (set-coding-category-system 'iso-8-designate 'ctext)
712 (set-coding-category-system 'no-conversion 'raw-text) 726 (set-coding-category-system 'no-conversion 'raw-text)
713 (set-coding-category-system 'shift-jis 'shift_jis) 727 (set-coding-category-system 'shift-jis 'shift_jis)
714 (set-coding-category-system 'big5 'big5) 728 (set-coding-category-system 'big5 'big5)
729 ;; #### Can we now assume the existence of the 10646 coding systems?
730 ;; #### These lists need to be synched with the ones in mule-coding.el.
715 (cond ((eq (coding-system-type (coding-category-system 'utf-8)) 'utf-8) 731 (cond ((eq (coding-system-type (coding-category-system 'utf-8)) 'utf-8)
716 (set-coding-category-system 'ucs-4 'iso-10646-ucs-4) 732 (set-coding-category-system 'ucs-4 'iso-10646-ucs-4)
717 (set-coding-category-system 'utf-8 'utf-8) 733 (set-coding-category-system 'utf-8 'utf-8)
718 (set-coding-priority-list 734 (set-coding-priority-list
719 '(iso-8-1 735 '(iso-7
736 no-conversion
737 utf-8
738 iso-8-1
720 iso-8-2 739 iso-8-2
721 iso-7 740 iso-8-designate
722 iso-lock-shift 741 iso-lock-shift
723 iso-8-designate
724 utf-8
725 ucs-4
726 no-conversion
727 shift-jis 742 shift-jis
728 big5)) 743 big5
744 ucs-4))
729 ) 745 )
730 (t 746 (t
731 (set-coding-priority-list 747 (set-coding-priority-list
732 '(iso-8-1 748 '(iso-7
749 no-conversion
750 iso-8-1
733 iso-8-2 751 iso-8-2
734 iso-7 752 iso-8-designate
735 iso-lock-shift 753 iso-lock-shift
736 iso-8-designate
737 no-conversion
738 shift-jis 754 shift-jis
739 big5)) 755 big5))
740 )) 756 ))
741 757
742 ;; (update-coding-systems-internal) 758 ;; (update-coding-systems-internal)
865 (defun set-language-environment-coding-systems (language-name 881 (defun set-language-environment-coding-systems (language-name
866 &optional eol-type) 882 &optional eol-type)
867 "Do various coding system setups for language environment LANGUAGE-NAME. 883 "Do various coding system setups for language environment LANGUAGE-NAME.
868 884
869 The optional arg EOL-TYPE specifies the eol-type of the default value 885 The optional arg EOL-TYPE specifies the eol-type of the default value
870 of buffer-file-coding-system set by this function." 886 of buffer-file-coding-system set by this function.
887
888 Note that `coding-priority-list' is not reset first; thus changing language
889 environment allows recognition of coding systems from previously set language
890 environments. (This will not work if the desired coding systems are from the
891 same category. E.g., starting with a Hebrew language environment, ISO 8859-8
892 will be recognized. If you shift to Russian, ISO 8859-8 will be shadowed by
893 ISO 8859-5, and cannot be automatically recognized without resetting the
894 language environment to Hebrew. However, if you shift from Japanese to
895 Russian, ISO-2022-JP will continue to be automatically recognized, since
896 ISO-8859-5 and ISO-2022-JP are different coding categories.)"
871 (let* ((priority (get-language-info language-name 'coding-priority)) 897 (let* ((priority (get-language-info language-name 'coding-priority))
872 (default-coding (car priority))) 898 (default-coding (car priority)))
873 (if priority 899 (if priority
874 (let ((categories (mapcar 'coding-system-category priority)) 900 (let ((categories (mapcar 'coding-system-category priority))
875 category checked-categories) 901 category checked-categories)