Initial revision
[bpt/emacs.git] / lisp / international / mule-conf.el
CommitLineData
08c19a27
KH
1;;; mule-conf.el --- configure multilingual environment
2
3;; Copyright (C) 1997 Free Software Foundation, Inc.
4;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
5
6;; Keywords: mule, multilingual, character set, coding system
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software; you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation; either version 2, or (at your option)
13;; any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23;; Boston, MA 02111-1307, USA.
24
25;;; Commentary:
26
27;; Don't byte-compile this file.
28
29;;; Code:
30
31;;; Definitions of character sets.
32
33;; Basic (official) character sets. These character sets are treated
34;; effectively in the aspect of memory in a buffer.
35
36;; Syntax:
37;; (define-charset CHARSET-ID CHARSET
38;; [ DIMENSION CHARS WIDTH DIRECTION ISO-FINAL-CHAR ISO-GRAPHIC-PLANE
39;; SHORT-NAME LONG-NAME DESCRIPTION ])
40;; ASCII charset is defined in src/charset.c as below.
41;; (define-charset 0 ascii
42;; [1 94 1 0 ?B 0 "ASCII" "ASCII" "ASCII (ISO646 IRV)"])
43
44(define-charset 129 'latin-iso8859-1
45 [1 96 1 0 ?A 1 "Latin-1" "ISO8859-1 (Latin-1)" "ISO8859-1 (Latin-1)"])
46(define-charset 130 'latin-iso8859-2
47 [1 96 1 0 ?B 1 "Latin-2" "ISO8859-2 (Latin-2)" "ISO8859-2 (Latin-2)"])
48(define-charset 131 'latin-iso8859-3
49 [1 96 1 0 ?C 1 "Latin-3" "ISO8859-3 (Latin-3)" "ISO8859-3 (Latin-3)"])
50(define-charset 132 'latin-iso8859-4
51 [1 96 1 0 ?D 1 "Latin-4" "ISO8859-4 (Latin-4)" "ISO8859-4 (Latin-4)"])
52(define-charset 133 'thai-tis620
53 [1 96 1 0 ?T 1 "TIS620" "TIS620 (Thai)" "TIS620.2529 (Thai)"])
54(define-charset 134 'greek-iso8859-7
55 [1 96 1 0 ?F 1 "ISO8859-7" "ISO8859-7 (Greek)" "ISO8859-7 (Greek)"])
56(define-charset 135 'arabic-iso8859-6
57 [1 96 1 1 ?G 1 "ISO8859-6" "ISO8859-6 (Arabic)" "ISO8859-6 (Arabic)"])
58(define-charset 136 'hebrew-iso8859-8
59 [1 96 1 1 ?H 1 "ISO8859-8" "ISO8859-8 (Hebrew)" "ISO8859-8 (Hebrew)"])
60(define-charset 137 'katakana-jisx0201
61 [1 94 1 0 ?I 1 "JISX0201 Kana" "JISX0201.1976 (Japanese Kana)"
62 "JISX0201.1976 Japanese Kana"])
63(define-charset 138 'latin-jisx0201
64 [1 94 1 0 ?J 0 "JISX0201 Roman" "JISX0201.1976 (Japanese Roman)"
65 "JISX0201.1976 Japanese Roman"])
66(define-charset 140 'cyrillic-iso8859-5
67 [1 96 1 0 ?L 1 "ISO8859-5" "ISO8859-5 (Cyrillic)"
68 "ISO8859-5 (Cyrillic)"])
69(define-charset 141 'latin-iso8859-9
70 [1 96 1 0 ?M 1 "Latin-5" "ISO8859-9 (Latin-5)" "ISO8859-9 (Latin-5)"])
71(define-charset 144 'japanese-jisx0208-1978
72 [2 94 2 0 ?@ 0 "JISX0208.1978" "JISX0208.1978 (Japanese)"
73 "JISX0208.1978 Japanese Kanji (so called \"old JIS\")"])
74(define-charset 145 'chinese-gb2312
75 [2 94 2 0 ?A 0 "GB2312" "GB2312" "GB2312 Chinese simplified"])
76(define-charset 146 'japanese-jisx0208
77 [2 94 2 0 ?B 0 "JISX0208" "JISX0208.1983/1990 (Japanese)"
78 "JISX0208.1983/1990 Japanese Kanji"])
79(define-charset 147 'korean-ksc5601
80 [2 94 2 0 ?C 0 "KSC5601" "KSC5601 (Korean)"
81 "KSC5601 Korean Hangul and Hanja"])
82(define-charset 148 'japanese-jisx0212
83 [2 94 2 0 ?D 0 "JISX0212" "JISX0212 (Japanese)"
84 "JISX0212 Japanese supplement"])
85(define-charset 149 'chinese-cns11643-1
86 [2 94 2 0 ?G 0 "CNS11643-1" "CNS11643-1 (Chinese traditional)"
87 "CNS11643 Plane 1 Chinese traditional"])
88(define-charset 150 'chinese-cns11643-2
89 [2 94 2 0 ?H 0 "CNS11643-2" "CNS11643-2 (Chinese traditional)"
90 "CNS11643 Plane 2 Chinese traditional"])
91(define-charset 152 'chinese-big5-1
92 [2 94 2 0 ?0 0 "Big5" "Big5 (Level-1)"
93 "Big5 Level-1 Chinese traditional"])
94(define-charset 153 'chinese-big5-2
95 [2 94 2 0 ?1 0 "Big5" "Big5 (Level-2)"
96 "Big5 Level-2 Chinese traditional"])
97
98;; Additional (private) character sets. These character sets are
99;; treated less effectively in the aspect of memory in a buffer.
100
101;; Syntax:
102;; (define-charset nil CHARSET
103;; [ DIMENSION CHARS WIDTH DIRECTION ISO-FINAL-CHAR ISO-GRAPHIC-PLANE
104;; SHORT-NAME LONG-NAME DESCRIPTION ])
105
106;; ISO-2022 allows a use of character sets not registered in ISO with
107;; final characters `0' (0x30) through `?' (0x3F). Among them, Emacs
108;; reserves `0' through `9' to support several private character sets.
109;; The remaining final characters `:' through `?' are for users.
110
111(define-charset nil 'chinese-sisheng
112 [1 94 1 0 ?0 0 "SiSheng" "SiSheng (PinYin/ZhuYin)"
113 "SiSheng characters for PinYin/ZhuYin"])
114
115;; IPA characters for phonetic symbols.
116(define-charset nil 'ipa
117 [1 96 1 0 ?0 1 "IPA" "IPA" "IPA (International Phonetic Association)"])
118
119;; Vietnamese VISCII. VISCII is 1-byte character set which contains
120;; more than 96 characters. Since Emacs can't handle it as one
121;; character set, it is divided into two: lower case letters and upper
122;; case letters.
123(define-charset nil 'vietnamese-viscii-lower
124 [1 96 1 0 ?1 1 "VISCII" "VISCII lower-case" "VISCII1.1 lower-case"])
125(define-charset nil 'vietnamese-viscii-upper
126 [1 96 1 0 ?2 1 "VISCII" "VISCII upper-case" "VISCII1.1 upper-case"])
127
128;; For Arabic, we need three different types of character sets.
129;; Digits are of direction left-to-right and of width 1-column.
130;; Others are of direction right-to-left and of width 1-column or
131;; 2-column.
132(define-charset nil 'arabic-digit
133 [1 94 1 0 ?2 0 "Arabic" "Arabic digit" "Arabic digit"])
134(define-charset nil 'arabic-1-column
135 [1 94 1 1 ?3 0 "Arabic" "Arabic 1-column" "Arabic 1-column"])
136(define-charset nil 'arabic-2-column
137 [1 94 2 1 ?4 0 "Arabic" "Arabic 2-column" "Arabic 2-column"])
138
139;; Ethiopic characters (Amahric and Tigrigna).
140(define-charset nil 'ethiopic
141 [2 94 2 0 ?2 0 "Ethio" "Ethio" "Ethiopic characters"])
142
143;; Chinese CNS11643 Plane3 thru Plane7. Although these are official
144;; character sets, the use is rare and don't have to be treated
145;; effectively in the aspect of memory in a buffer.
146(define-charset nil 'chinese-cns11643-3
147 [2 94 2 0 ?I 0 "CNS11643-3" "CNS11643-3 (Chinese traditional)"
148 "CNS11643 Plane 3 Chinese Traditional"])
149(define-charset nil 'chinese-cns11643-4
150 [2 94 2 0 ?J 0 "CNS11643-4" "CNS11643-4 (Chinese traditional)"
151 "CNS11643 Plane 4 Chinese Traditional"])
152(define-charset nil 'chinese-cns11643-5
153 [2 94 2 0 ?K 0 "CNS11643-5" "CNS11643-5 (Chinese traditional)"
154 "CNS11643 Plane 5 Chinese Traditional"])
155(define-charset nil 'chinese-cns11643-6
156 [2 94 2 0 ?L 0 "CNS11643-6" "CNS11643-6 (Chinese traditional)"
157 "CNS11643 Plane 6 Chinese Traditional"])
158(define-charset nil 'chinese-cns11643-7
159 [2 94 2 0 ?M 0 "CNS11643-7" "CNS11643-7 (Chinese traditional)"
160 "CNS11643 Plane 7 Chinese Traditional"])
161
162;; ASCII with right-to-left direction.
163(define-charset nil 'ascii-right-to-left
164 [1 94 1 1 ?B 0 "rev ASCII" "ASCII with right-to-left direction"
165 "ASCII (left half of ISO8859-1) with right-to-left direction"])
166
167;; Indian scripts. Symbolic charset for data exchange. Glyphs are
168;; not assigned. They are automatically converted to each Indian
169;; script which IS-13194 supports.
170
171(define-charset nil 'indian-is13194
172 [1 94 2 0 ?5 1 "IS 13194" "Indian IS 13194"
173 "Generic Indian charset for data exchange with IS 13194"])
174;; Actual Glyph for 2-column width.
175(define-charset nil 'indian-2-column
176 [2 94 2 0 ?5 0 "Indian" "Indian 2 Column"
177 "Indian charset for 2-column width glyphs"])
178;; Actual Glyph for 1-column width.
179(define-charset nil 'indian-1-column
180 [2 94 1 0 ?6 0 "Indian" "Indian 1 Column"
181 "Indian charset for 2-column width glypps"])
182
183;; Lao script.
184;; ISO10646's 0x0E80..0x0EDF are mapped to 0x20..0x7F.
185(define-charset nil 'lao
186 [1 94 1 0 ?1 0 "Lao" "Lao" "Lao characters (ISO10646 0E80..0EDF)"])
187
188
189;; This is a table of alternate charsets.
190(setq alternate-charset-table
191 '((japanese-jisx0208-1978 japanese-jisx0208)
192 (latin-jisx0201 ascii)))
193
194;; Tell C code charset ID's of several charsets.
195(setup-special-charsets)
196
197\f
198;;; Make fundamental coding systems.
199
200;; Miscellaneous coding systems which can't be made by
201;; `make-coding-system'.
202
203(put 'no-conversion 'coding-system
204 (vector nil ?= "Do no conversion" nil nil))
205(put 'no-conversion 'eol-type 0)
206
207(put 'automatic-conversion-unix 'coding-system 'automatic-conversion)
208(put 'automatic-conversion-unix 'eol-type 0)
209(put 'automatic-conversion-dos 'coding-system 'automatic-conversion)
210(put 'automatic-conversion-dos 'eol-type 1)
211(put 'automatic-conversion-mac 'coding-system 'automatic-conversion)
212(put 'automatic-conversion-mac 'eol-type 2)
213(put 'automatic-conversion 'coding-system
214 (vector t ?+ "Detect coding-system automatically" nil nil))
215(put 'automatic-conversion 'eol-type
216 (vector 'automatic-conversion-unix
217 'automatic-conversion-dos
218 'automatic-conversion-mac))
219
220;; Coding systems not specific to each language environment.
221
222(make-coding-system
223 'coding-system-internal 0 ?=
224 "Internal coding system used in a buffer.")
225
226(make-coding-system
227 'coding-system-iso-2022-7 2 ?J
228 "Coding system based on ISO2022 7-bit encoding."
229 '((ascii t) nil nil nil
230 short ascii-eol ascii-cntl seven))
231
232(make-coding-system
233 'coding-system-iso-2022-int 2 ?I
234 "ISO-2022-INT-1"
235 '((ascii t) (korean-ksc5601 t) nil nil
236 short ascii-eol ascii-cntl seven locking-shift))
237
238(make-coding-system
239 'coding-system-iso-2022-int-2 2 ?I
240 "ISO-2022-INT-2"
241 '((ascii t)
242 (nil korean-ksc5601 chinese-gb2312 chinese-cns11643-1 t)
243 (nil chinese-cns11643-2)
244 (nil chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5
245 chinese-cns11643-6 chinese-cns11643-7)
246 short ascii-eol ascii-cntl seven locking-shift single-shift))
247
248(make-coding-system
249 'coding-system-iso-2022-ss2-8 2 ?I
250 "ISO-2022 coding system using SS2 for 96-charset in 8-bit code."
251 '((ascii t) nil t nil
252 nil ascii-eol ascii-cntl nil nil single-shift))
253
254(make-coding-system
255 'coding-system-iso-2022-ss2-7 2 ?I
256 "ISO-2022 coding system using SS2 for 96-charset in 7-bit code."
257 '((ascii t) nil t nil
258 short ascii-eol ascii-cntl seven nil single-shift))
259
260(make-coding-system
261 'coding-system-iso-2022-lock 2 ?i
262 "ISO-2022 coding system using Locking-Shift for 96-charset."
263 '((ascii t) t nil nil
264 nil ascii-eol ascii-cntl locking-shift))
265
266;; The other coding-systems are defined in each language specific
267;; section of languages.el.
268
269;; Setting coding system 'automatic-conversion for reading any files.
270;; Though, compiled Emacs Lisp files (*.elc) should never be decoded
271;; nor encoded.
272
273(setq coding-system-alist
274 '((insert-file-contents
275 ("\\.elc$" . (no-conversion . nil))
276 ("loaddefs.el$" . (no-conversion . nil))
277 ("" . (automatic-conversion . nil)))
278 (write-region
279 ("\\.elc$" . (nil . no-conversion))
280 ("loaddefs.el$" . (nil . no-conversion)))))
281
282\f
283;;; Setting coding categories and their priorities.
284
285;; This setting is just to read an Emacs Lisp source files which
286;; contain multilingual text while dumping Emacs. More appropriate
287;; values are set by the command `setup-language-environment' for each
288;; language environment.
289
290(setq coding-category-internal 'coding-system-internal
291 coding-category-sjis 'coding-system-sjis
292 coding-category-iso-7 'coding-system-iso-2022-7
293 coding-category-iso-8-1 'coding-system-iso-8859-1
294 coding-category-iso-8-2 'coding-system-euc-japan
295 coding-category-iso-else 'coding-system-iso-2022-int
296 coding-category-big5 'coding-system-big5
297 coding-category-binary 'no-conversion)
298
299(set-coding-priority
300 '(coding-category-iso-7
301 coding-category-iso-8-2
302 coding-category-iso-8-1
303 coding-category-iso-else
304 coding-category-sjis
305 coding-category-big5
306 coding-category-binary
307 coding-category-internal))
308
309;;; mule-conf.el ends here