comparison lisp/mule/mule-coding.el @ 771:943eaba38521

[xemacs-hg @ 2002-03-13 08:51:24 by ben] The big ben-mule-21-5 check-in! Various files were added and deleted. See CHANGES-ben-mule. There are still some test suite failures. No crashes, though. Many of the failures have to do with problems in the test suite itself rather than in the actual code. I'll be addressing these in the next day or so -- none of the test suite failures are at all critical. Meanwhile I'll be trying to address the biggest issues -- i.e. build or run failures, which will almost certainly happen on various platforms. All comments should be sent to ben@xemacs.org -- use a Cc: if necessary when sending to mailing lists. There will be pre- and post- tags, something like pre-ben-mule-21-5-merge-in, and post-ben-mule-21-5-merge-in.
author ben
date Wed, 13 Mar 2002 08:54:06 +0000
parents ef4d2466a29c
children aa28d959af41
comparison
equal deleted inserted replaced
770:336a418893b5 771:943eaba38521
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation. 4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 1995 Amdahl Corporation. 5 ;; Copyright (C) 1995 Amdahl Corporation.
6 ;; Copyright (C) 1995 Sun Microsystems. 6 ;; Copyright (C) 1995 Sun Microsystems.
7 ;; Copyright (C) 1997 MORIOKA Tomohiko 7 ;; Copyright (C) 1997 MORIOKA Tomohiko
8 ;; Copyright (C) 2001 Ben Wing.
8 9
9 ;; This file is part of XEmacs. 10 ;; This file is part of XEmacs.
10 11
11 ;; XEmacs is free software; you can redistribute it and/or modify it 12 ;; XEmacs is free software; you can redistribute it and/or modify it
12 ;; under the terms of the GNU General Public License as published by 13 ;; under the terms of the GNU General Public License as published by
59 60
60 (defun coding-system-lock-shift (coding-system) 61 (defun coding-system-lock-shift (coding-system)
61 "Return the 'lock-shift property of CODING-SYSTEM." 62 "Return the 'lock-shift property of CODING-SYSTEM."
62 (coding-system-property coding-system 'lock-shift)) 63 (coding-system-property coding-system 'lock-shift))
63 64
64 (defun coding-system-charset (coding-system register)
65 "Return the charset initially designated to REGISTER in CODING-SYSTEM.
66 The allowable range of REGISTER is 0 through 3."
67 (if (or (< register 0) (> register 3))
68 (error 'args-out-of-range "coding-system-charset REGISTER" register 0 3))
69 (coding-system-property coding-system (nth register '(charset-g0
70 charset-g1
71 charset-g2
72 charset-g3))))
73
74 ;;(defun coding-system-use-japanese-jisx0201-roman (coding-system) 65 ;;(defun coding-system-use-japanese-jisx0201-roman (coding-system)
75 ;; "Return the 'use-japanese-jisx0201-roman property of CODING-SYSTEM." 66 ;; "Return the 'use-japanese-jisx0201-roman property of CODING-SYSTEM."
76 ;; (coding-system-property coding-system 'use-japanese-jisx0201-roman)) 67 ;; (coding-system-property coding-system 'use-japanese-jisx0201-roman))
77 68
78 ;;(defun coding-system-use-japanese-jisx0208-1978 (coding-system) 69 ;;(defun coding-system-use-japanese-jisx0208-1978 (coding-system)
89 80
90 (defun coding-system-ccl-decode (coding-system) 81 (defun coding-system-ccl-decode (coding-system)
91 "Return the CCL 'decode property of CODING-SYSTEM." 82 "Return the CCL 'decode property of CODING-SYSTEM."
92 (coding-system-property coding-system 'decode)) 83 (coding-system-property coding-system 'decode))
93 84
85 (defun coding-system-iso2022-charset (coding-system register)
86 "Return the charset initially designated to REGISTER in CODING-SYSTEM.
87 The allowable range of REGISTER is 0 through 3."
88 (if (or (< register 0) (> register 3))
89 (error 'args-out-of-range "coding-system-charset REGISTER" register 0 3))
90 (coding-system-property coding-system (nth register '(charset-g0
91 charset-g1
92 charset-g2
93 charset-g3))))
94
94 95
95 ;;;; Definitions of predefined coding systems 96 ;;;; Definitions of predefined coding systems
96 97
97 (make-coding-system 98 (make-coding-system
98 'ctext 'iso2022 99 'ctext 'iso2022
99 "Coding-system used in X as Compound Text Encoding." 100 "Compound Text"
100 '(charset-g0 ascii 101 '(charset-g0 ascii
101 charset-g1 latin-iso8859-1 102 charset-g1 latin-iso8859-1
102 eol-type nil 103 eol-type nil
103 mnemonic "CText")) 104 mnemonic "CText"))
104 105
105 ;;; iso-8859-1 and ctext are aliases.
106
107 ;; (copy-coding-system 'ctext 'iso-8859-1)
108 (make-coding-system 106 (make-coding-system
109 'iso-8859-1 'no-conversion 107 'iso-8859-1 'no-conversion
110 "Coding-system used in X as Compound Text Encoding." 108 "ISO-8859-1 (Latin-1)"
111 '(eol-type nil mnemonic "Noconv")) 109 '(eol-type nil mnemonic "Noconv"))
112 110
113 (make-coding-system 111 (make-coding-system
114 'iso-2022-8bit-ss2 'iso2022 112 'iso-2022-8bit-ss2 'iso2022
115 "ISO-2022 coding system using SS2 for 96-charset in 8-bit code." 113 "ISO-2022 8-bit w/SS2"
116 '(charset-g0 ascii 114 '(charset-g0 ascii
117 charset-g1 latin-iso8859-1 115 charset-g1 latin-iso8859-1
118 charset-g2 t ;; unspecified but can be used later. 116 charset-g2 t ;; unspecified but can be used later.
119 short t 117 short t
120 mnemonic "ISO8/SS" 118 mnemonic "ISO8/SS"
119 documentation "ISO 2022 based 8-bit encoding using SS2 for 96-charset"
121 )) 120 ))
122 121
123 (make-coding-system 122 (make-coding-system
124 'iso-2022-7bit-ss2 'iso2022 123 'iso-2022-7bit-ss2 'iso2022
125 "ISO-2022 coding system using SS2 for 96-charset in 7-bit code." 124 "ISO-2022 7-bit w/SS2"
126 '(charset-g0 ascii 125 '(charset-g0 ascii
127 charset-g2 t ;; unspecified but can be used later. 126 charset-g2 t ;; unspecified but can be used later.
128 seven t 127 seven t
129 short t 128 short t
130 mnemonic "ISO7/SS" 129 mnemonic "ISO7/SS"
130 documentation "ISO 2022 based 7-bit encoding using SS2 for 96-charset"
131 eol-type nil)) 131 eol-type nil))
132 132
133 ;; (copy-coding-system 'iso-2022-7bit-ss2 'iso-2022-jp-2) 133 ;; (copy-coding-system 'iso-2022-7bit-ss2 'iso-2022-jp-2)
134 (make-coding-system 134 (make-coding-system
135 'iso-2022-jp-2 'iso2022 135 'iso-2022-jp-2 'iso2022
136 "ISO-2022 coding system using SS2 for 96-charset in 7-bit code." 136 "ISO-2022-JP-2"
137 '(charset-g0 ascii 137 '(charset-g0 ascii
138 charset-g2 t ;; unspecified but can be used later. 138 charset-g2 t ;; unspecified but can be used later.
139 seven t 139 seven t
140 short t 140 short t
141 mnemonic "ISO7/SS" 141 mnemonic "ISO7/SS"
142 eol-type nil)) 142 eol-type nil))
143 143
144 (make-coding-system 144 (make-coding-system
145 'iso-2022-7bit 'iso2022 145 'iso-2022-7bit 'iso2022
146 "ISO 2022 based 7-bit encoding using only G0" 146 "ISO 2022 7-bit"
147 '(charset-g0 ascii 147 '(charset-g0 ascii
148 seven t 148 seven t
149 short t 149 short t
150 mnemonic "ISO7")) 150 mnemonic "ISO7"
151 documentation "ISO-2022-based 7-bit encoding using only G0"
152 ))
151 153
152 ;; compatibility for old XEmacsen 154 ;; compatibility for old XEmacsen
153 (copy-coding-system 'iso-2022-7bit 'iso-2022-7) 155 (define-coding-system-alias 'iso-2022-7 'iso-2022-7bit)
154 156
155 (make-coding-system 157 (make-coding-system
156 'iso-2022-8 'iso2022 158 'iso-2022-8 'iso2022
157 "ISO-2022 eight-bit coding system. No single-shift or locking-shift." 159 "ISO-2022 8-bit"
158 '(charset-g0 ascii 160 '(charset-g0 ascii
159 charset-g1 latin-iso8859-1 161 charset-g1 latin-iso8859-1
160 short t 162 short t
161 mnemonic "ISO8" 163 mnemonic "ISO8"
164 documentation "ISO-2022 eight-bit coding system. No single-shift or locking-shift."
162 )) 165 ))
163 166
164 (make-coding-system 167 (make-coding-system
165 'escape-quoted 'iso2022 168 'escape-quoted 'iso2022
166 "ISO-2022 eight-bit coding system with escape quoting; used for .ELC files." 169 "Escape-Quoted (for .ELC files)"
167 '(charset-g0 ascii 170 '(charset-g0 ascii
168 charset-g1 latin-iso8859-1 171 charset-g1 latin-iso8859-1
169 eol-type lf 172 eol-type lf
170 escape-quoted t 173 escape-quoted t
171 mnemonic "ESC/Quot" 174 mnemonic "ESC/Quot"
175 documentation "ISO-2022 eight-bit coding system with escape quoting; used for .ELC files."
172 )) 176 ))
173 177
174 (make-coding-system 178 (make-coding-system
175 'iso-2022-lock 'iso2022 179 'iso-2022-lock 'iso2022
176 "ISO-2022 coding system using Locking-Shift for 96-charset." 180 "ISO-2022 w/locking-shift"
177 '(charset-g0 ascii 181 '(charset-g0 ascii
178 charset-g1 t ;; unspecified but can be used later. 182 charset-g1 t ;; unspecified but can be used later.
179 seven t 183 seven t
180 lock-shift t 184 lock-shift t
181 mnemonic "ISO7/Lock" 185 mnemonic "ISO7/Lock"
186 documentation "ISO-2022 coding system using Locking-Shift for 96-charset."
182 )) 187 ))
183 188
184 ;; initialize the coding categories to something semi-reasonable
185 ;; so that the remaining Lisp files can contain extended characters.
186 ;; (They will be in ISO-7 format)
187 ;; #### This list needs to be synched with the ones in mule-cmds.el.
188
189 (set-coding-priority-list '(iso-7
190 no-conversion
191 ;; utf-8
192 iso-8-1
193 iso-8-2
194 iso-8-designate
195 iso-lock-shift
196 shift-jis
197 big5
198 ;; ucs-4
199 ))
200
201 (set-coding-category-system 'iso-7 'iso-2022-7)
202 (set-coding-category-system 'iso-8-designate 'ctext)
203 (set-coding-category-system 'iso-8-1 'ctext)
204 (set-coding-category-system 'iso-lock-shift 'iso-2022-lock)
205 (set-coding-category-system 'no-conversion 'no-conversion)
206
207 (setq-default buffer-file-coding-system 'iso-2022-8)
208
209 ;;; mule-coding.el ends here 189 ;;; mule-coding.el ends here