]> code.delx.au - gnu-emacs/blob - lisp/language/european.el
(compound-text, ctext): Moved to international/mule-conf.el.
[gnu-emacs] / lisp / language / european.el
1 ;;; european.el --- European languages -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5
6 ;; Keywords: multilingual, European
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 ;; For Europeans, character sets ISO8859-1,2,3,4,9,14,15 are supported.
28
29 ;;; Code:
30
31 ;; Latin-1 (ISO-8859-1)
32
33 (make-coding-system
34 'iso-latin-1 2 ?1
35 "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)"
36 '(ascii latin-iso8859-1 nil nil
37 nil nil nil nil nil nil nil nil nil nil nil nil t)
38 '((safe-charsets ascii latin-iso8859-1)
39 (mime-charset . iso-8859-1)))
40
41 (define-coding-system-alias 'iso-8859-1 'iso-latin-1)
42 (define-coding-system-alias 'latin-1 'iso-latin-1)
43
44 (set-language-info-alist
45 "Latin-1" '((charset ascii latin-iso8859-1)
46 (coding-system iso-latin-1)
47 (coding-priority iso-latin-1)
48 (nonascii-translation . latin-iso8859-1)
49 (unibyte-syntax . "latin-1")
50 (unibyte-display . iso-latin-1)
51 (input-method . "latin-1-prefix")
52 (sample-text
53 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
54 (documentation . "\
55 This language environment is a generic one for the Latin-1 (ISO-8859-1)
56 character set which supports the following European languages:
57 Albanian, Basque, Breton, Catalan, Danish, Dutch, English, Faeroese,
58 Finnish, French (with restrictions -- see Latin-9), Frisian, Galician,
59 German, Greenlandic, Icelandic, Irish Gaelic (new orthography),
60 Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic,
61 Scottish Gaelic, Spanish, and Swedish.
62 We also have a German specific language environment \"German\".
63
64 Latin-1 also covers several written languages outside Europe, including
65 Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
66 '("European"))
67
68 \f
69 ;; Latin-2 (ISO-8859-2)
70
71 (make-coding-system
72 'iso-latin-2 2 ?2
73 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
74 '(ascii latin-iso8859-2 nil nil
75 nil nil nil nil nil nil nil)
76 '((safe-charsets ascii latin-iso8859-2)
77 (mime-charset . iso-8859-2)))
78
79 (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
80 (define-coding-system-alias 'latin-2 'iso-latin-2)
81
82 (set-language-info-alist
83 "Latin-2" '((charset ascii latin-iso8859-2)
84 (coding-system iso-latin-2)
85 (coding-priority iso-latin-2)
86 (nonascii-translation . latin-iso8859-2)
87 (unibyte-syntax . "latin-2")
88 (unibyte-display . iso-latin-2)
89 (input-method . "latin-2-prefix")
90 (documentation . "\
91 This language environment is a generic one for the Latin-2 (ISO-8859-2)
92 character set which supports the following languages:
93 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
94 Serbo-Croatian or Croatian, Slovak, Slovene, Sorbian (upper and lower),
95 and Swedish.
96 We also have specific language environments for the following languages:
97 For Czech, \"Czech\".
98 For Romanian, \"Romanian\".
99 For Slovak, \"Slovak\"."))
100 '("European"))
101
102 \f
103 ;; Latin-3 (ISO-8859-3)
104
105 (make-coding-system
106 'iso-latin-3 2 ?3
107 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
108 '(ascii latin-iso8859-3 nil nil
109 nil nil nil nil nil nil nil)
110 '((safe-charsets ascii latin-iso8859-3)
111 (mime-charset . iso-8859-3)))
112
113 (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
114 (define-coding-system-alias 'latin-3 'iso-latin-3)
115
116 (set-language-info-alist
117 "Latin-3" '((charset ascii latin-iso8859-3)
118 (coding-system iso-latin-3)
119 (coding-priority iso-latin-3)
120 (nonascii-translation . latin-iso8859-3)
121 (unibyte-syntax . "latin-3")
122 (unibyte-display . iso-latin-3)
123 (input-method . "latin-3-prefix")
124 (documentation . "\
125 These languages are supported with the Latin-3 (ISO-8859-3) character set:
126 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
127 German, Italian, Maltese, Spanish, and Turkish."))
128 '("European"))
129
130 \f
131 ;; Latin-4 (ISO-8859-4)
132
133 (make-coding-system
134 'iso-latin-4 2 ?4
135 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)"
136 '(ascii latin-iso8859-4 nil nil
137 nil nil nil nil nil nil nil)
138 '((safe-charsets ascii latin-iso8859-4)
139 (mime-charset . iso-8859-4)))
140
141 (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
142 (define-coding-system-alias 'latin-4 'iso-latin-4)
143
144 (set-language-info-alist
145 "Latin-4" '((charset ascii latin-iso8859-4)
146 (coding-system iso-8859-4)
147 (coding-priority iso-8859-4)
148 (nonascii-translation . latin-iso8859-4)
149 (unibyte-syntax . "latin-4")
150 (unibyte-display . iso-8859-4)
151 (input-method . "latin-4-prefix")
152 (documentation . "\
153 These languages are supported with the Latin-4 (ISO-8859-4) character set:
154 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
155 Latvian, Lithuanian, and Norwegian."))
156 '("European"))
157
158 \f
159 ;; Latin-5 (ISO-8859-9)
160
161 (make-coding-system
162 'iso-latin-5 2 ?9
163 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
164 '(ascii latin-iso8859-9 nil nil
165 nil nil nil nil nil nil nil)
166 '((safe-charsets ascii latin-iso8859-9)
167 (mime-charset . iso-8859-9)))
168
169 (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
170 (define-coding-system-alias 'latin-5 'iso-latin-5)
171
172 (set-language-info-alist
173 "Latin-5" '((charset ascii latin-iso8859-9)
174 (coding-system iso-latin-5)
175 (coding-priority iso-latin-5)
176 (nonascii-translation . latin-iso8859-9)
177 (unibyte-syntax . "latin-5")
178 (unibyte-display . iso-latin-5)
179 (input-method . "latin-5-prefix")
180 (documentation . "\
181 These languages are supported with the Latin-5 (ISO-8859-9) character set:
182 Bulgarian, Byelorussian, (Slavic) Macedonian, Russian, Serbian and
183 Ukranian.")) ; says ISO 8859-1
184 '("European"))
185
186 \f
187 ;; Latin-8 (ISO-8859-14)
188
189 (make-coding-system
190 'iso-latin-8 2 ?W ; `W' for `Welsh', since `C'
191 ; for `Celtic' is taken.
192 "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)"
193 '(ascii latin-iso8859-14 nil nil
194 nil nil nil nil nil nil nil nil nil nil nil nil t)
195 '((safe-charsets ascii latin-iso8859-14)
196 (mime-charset . iso-8859-14)))
197
198 (define-coding-system-alias 'iso-8859-14 'iso-latin-8)
199 (define-coding-system-alias 'latin-8 'iso-latin-8)
200
201 (set-language-info-alist
202 "Latin-8" '((charset ascii latin-iso8859-14)
203 (coding-system iso-latin-8)
204 (coding-priority iso-latin-8)
205 (nonascii-translation . latin-iso8859-14)
206 (unibyte-syntax . "latin-8")
207 (unibyte-display . iso-latin-8)
208 (input-method . "latin-8-prefix")
209 ;; Fixme: Welsh/Ga{e}lic greetings
210 (sample-text . "\e,_"\e(B \e,_p\e(B \e,_^\e(B")
211 (documentation . "\
212 This language environment is a generic one for the Latin-8 (ISO-8859-14)
213 character set which supports the Celtic languages, including those not
214 covered by other ISO-8859 character sets: Welsh, Manx Gaelic and
215 Irish Gaelic (old orthography)."))
216 '("European"))
217 \f
218 ;; Latin-9 (ISO-8859-15)
219
220 (make-coding-system
221 'iso-latin-9 2 ?0 ; `0' for `Latin-0'
222 "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)"
223 '(ascii latin-iso8859-15 nil nil
224 nil nil nil nil nil nil nil nil nil nil nil nil t)
225 '((safe-charsets ascii latin-iso8859-15)
226 (mime-charset . iso-8859-15)))
227
228 (define-coding-system-alias 'iso-8859-15 'iso-latin-9)
229 (define-coding-system-alias 'latin-9 'iso-latin-9)
230 (define-coding-system-alias 'latin-0 'iso-latin-9)
231
232 (set-language-info-alist
233 "Latin-9" '((charset ascii latin-iso8859-15)
234 (coding-system iso-latin-9)
235 (coding-priority iso-latin-9)
236 (nonascii-translation . latin-iso8859-15)
237 (unibyte-syntax . "latin-9")
238 (unibyte-display . iso-latin-9)
239 (input-method . "latin-9-prefix")
240 (sample-text
241 . "AVE. \e,b&(48<=>\e(B \e,b$\e(B")
242 (documentation . "\
243 This language environment is a generic one for the Latin-9 (ISO-8859-15)
244 character set which supports the same languages as Latin-1 with the
245 addition of the Euro sign and some additional French and Finnish letters.
246 Latin-9 is sometimes nicknamed `Latin-0'."))
247 '("European"))
248 \f
249 (set-language-info-alist
250 "German" '((tutorial . "TUTORIAL.de")
251 (charset ascii latin-iso8859-1)
252 (coding-system iso-latin-1)
253 (coding-priority iso-latin-1)
254 (input-method . "german-postfix")
255 (nonascii-translation . iso-latin-1)
256 (unibyte-syntax . "latin-1")
257 (unibyte-display . iso-latin-1)
258 (sample-text . "\
259 German (Deutsch Nord) Guten Tag
260 German (Deutsch S\e,A|\e(Bd) Gr\e,A|_\e(B Gott")
261 (documentation . "\
262 This language environment is almost the same as Latin-1,
263 but default input method is set to \"german-postfix\"."))
264 '("European"))
265
266 (set-language-info-alist
267 "Slovenian" '((charset . (ascii latin-iso8859-2))
268 (coding-system . (iso-8859-2))
269 (coding-priority . (iso-8859-2))
270 (nonascii-translation . latin-iso8859-2)
271 (input-method . "latin-2-postfix")
272 (unibyte-syntax . "latin-2")
273 (unibyte-display . iso-8859-2)
274 (tutorial . "TUTORIAL.sl")
275 (sample-text . "\e,B.\e(Belimo vam uspe\e,B9\e(Ben dan!")
276 (documentation . t))
277 '("European"))
278
279 ;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
280 ;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
281 ;; was used for Turkish. Those who use Latin-3 for Turkish should use
282 ;; "Latin-3" language environment.
283
284 (set-language-info-alist
285 "Turkish" '((charset ascii latin-iso8859-9)
286 (coding-system iso-latin-5)
287 (coding-priority iso-latin-5)
288 (nonascii-translation . latin-iso8859-9)
289 (unibyte-syntax . "latin-5")
290 (unibyte-display . iso-latin-5)
291 (input-method . "turkish-postfix")
292 (sample-text . "Turkish (T\e,M|\e(Brk\e,Mg\e(Be) Merhaba")
293 (documentation . t)))
294
295 ;; Polish ISO 8859-2 environment.
296 ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
297 ;; Keywords: multilingual, Polish
298
299 (set-language-info-alist
300 "Polish" '((charset . (ascii latin-iso8859-2))
301 (coding-system . (iso-8859-2))
302 (coding-priority . (iso-8859-2))
303 (input-method . "polish-slash")
304 (nonascii-translation . latin-iso8859-2)
305 (unibyte-syntax . "latin-2")
306 (unibyte-display . iso-8859-2)
307 (tutorial . "TUTORIAL.pl")
308 (sample-text . "\e,B1!fFjJ3#qQsS6&?/<,\e(B")
309 (documentation . t))
310 '("European"))
311
312 \f
313 ;; Definitions for the Mac Roman character sets and coding system.
314 ;; The Mac Roman encoding uses all 128 code points in the range 128 to
315 ;; 255 for actual characters. Emacs decode them to one of the
316 ;; following character sets.
317 ;; ascii, latin-iso8859-1, mule-unicode-0100-24ff,
318 ;; mule-unicode-2500-33ff, mule-unicode-e000-ffff
319
320 (let
321 ((encoding-vector (make-vector 256 nil))
322 (i 0)
323 (vec ;; mac-roman (128..255) -> UCS mapping
324 [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS
325 #x00C5 ;; 129:LATIN CAPITAL LETTER A WITH RING ABOVE
326 #x00C7 ;; 130:LATIN CAPITAL LETTER C WITH CEDILLA
327 #x00C9 ;; 131:LATIN CAPITAL LETTER E WITH ACUTE
328 #x00D1 ;; 132:LATIN CAPITAL LETTER N WITH TILDE
329 #x00D6 ;; 133:LATIN CAPITAL LETTER O WITH DIAERESIS
330 #x00DC ;; 134:LATIN CAPITAL LETTER U WITH DIAERESIS
331 #x00E1 ;; 135:LATIN SMALL LETTER A WITH ACUTE
332 #x00E0 ;; 136:LATIN SMALL LETTER A WITH GRAVE
333 #x00E2 ;; 137:LATIN SMALL LETTER A WITH CIRCUMFLEX
334 #x00E4 ;; 138:LATIN SMALL LETTER A WITH DIAERESIS
335 #x00E3 ;; 139:LATIN SMALL LETTER A WITH TILDE
336 #x00E5 ;; 140:LATIN SMALL LETTER A WITH RING ABOVE
337 #x00E7 ;; 141:LATIN SMALL LETTER C WITH CEDILLA
338 #x00E9 ;; 142:LATIN SMALL LETTER E WITH ACUTE
339 #x00E8 ;; 143:LATIN SMALL LETTER E WITH GRAVE
340 #x00EA ;; 144:LATIN SMALL LETTER E WITH CIRCUMFLEX
341 #x00EB ;; 145:LATIN SMALL LETTER E WITH DIAERESIS
342 #x00ED ;; 146:LATIN SMALL LETTER I WITH ACUTE
343 #x00EC ;; 147:LATIN SMALL LETTER I WITH GRAVE
344 #x00EE ;; 148:LATIN SMALL LETTER I WITH CIRCUMFLEX
345 #x00EF ;; 149:LATIN SMALL LETTER I WITH DIAERESIS
346 #x00F1 ;; 150:LATIN SMALL LETTER N WITH TILDE
347 #x00F3 ;; 151:LATIN SMALL LETTER O WITH ACUTE
348 #x00F2 ;; 152:LATIN SMALL LETTER O WITH GRAVE
349 #x00F4 ;; 153:LATIN SMALL LETTER O WITH CIRCUMFLEX
350 #x00F6 ;; 154:LATIN SMALL LETTER O WITH DIAERESIS
351 #x00F5 ;; 155:LATIN SMALL LETTER O WITH TILDE
352 #x00FA ;; 156:LATIN SMALL LETTER U WITH ACUTE
353 #x00F9 ;; 157:LATIN SMALL LETTER U WITH GRAVE
354 #x00FB ;; 158:LATIN SMALL LETTER U WITH CIRCUMFLEX
355 #x00FC ;; 159:LATIN SMALL LETTER U WITH DIAERESIS
356 #x2020 ;; 160:DAGGER
357 #x00B0 ;; 161:DEGREE SIGN
358 #x00A2 ;; 162:CENT SIGN
359 #x00A3 ;; 163:POUND SIGN
360 #x00A7 ;; 164:SECTION SIGN
361 #x2022 ;; 165:BULLET
362 #x00B6 ;; 166:PILCROW SIGN
363 #x00DF ;; 167:LATIN SMALL LETTER SHARP S
364 #x00AE ;; 168:REGISTERED SIGN
365 #x00A9 ;; 169:COPYRIGHT SIGN
366 #x2122 ;; 170:TRADE MARK SIGN
367 #x00B4 ;; 171:ACUTE ACCENT
368 #x00A8 ;; 172:DIAERESIS
369 #x2260 ;; 173:NOT EQUAL TO
370 #x00C6 ;; 174:LATIN CAPITAL LETTER AE
371 #x00D8 ;; 175:LATIN CAPITAL LETTER O WITH STROKE
372 #x221E ;; 176:INFINITY
373 #x00B1 ;; 177:PLUS-MINUS SIGN
374 #x2264 ;; 178:LESS-THAN OR EQUAL TO
375 #x2265 ;; 179:GREATER-THAN OR EQUAL TO
376 #x00A5 ;; 180:YEN SIGN
377 #x00B5 ;; 181:MICRO SIGN
378 #x2202 ;; 182:PARTIAL DIFFERENTIAL
379 #x2211 ;; 183:N-ARY SUMMATION
380 #x220F ;; 184:N-ARY PRODUCT
381 #x03C0 ;; 185:GREEK SMALL LETTER PI
382 #x222B ;; 186:INTEGRAL
383 #x00AA ;; 187:FEMININE ORDINAL INDICATOR
384 #x00BA ;; 188:MASCULINE ORDINAL INDICATOR
385 #x03A9 ;; 189:GREEK CAPITAL LETTER OMEGA
386 #x00E6 ;; 190:LATIN SMALL LETTER AE
387 #x00F8 ;; 191:LATIN SMALL LETTER O WITH STROKE
388 #x00BF ;; 192:INVERTED QUESTION MARK
389 #x00A1 ;; 193:INVERTED EXCLAMATION MARK
390 #x00AC ;; 194:NOT SIGN
391 #x221A ;; 195:SQUARE ROOT
392 #x0192 ;; 196:LATIN SMALL LETTER F WITH HOOK
393 #x2248 ;; 197:ALMOST EQUAL TO
394 #x2206 ;; 198:INCREMENT
395 #x00AB ;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
396 #x00BB ;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
397 #x2026 ;; 201:HORIZONTAL ELLIPSIS
398 #x00A0 ;; 202:NO-BREAK SPACE
399 #x00C0 ;; 203:LATIN CAPITAL LETTER A WITH GRAVE
400 #x00C3 ;; 204:LATIN CAPITAL LETTER A WITH TILDE
401 #x00D5 ;; 205:LATIN CAPITAL LETTER O WITH TILDE
402 #x0152 ;; 206:LATIN CAPITAL LIGATURE OE
403 #x0153 ;; 207:LATIN SMALL LIGATURE OE
404 #x2013 ;; 208:EN DASH
405 #x2014 ;; 209:EM DASH
406 #x201C ;; 210:LEFT DOUBLE QUOTATION MARK
407 #x201D ;; 211:RIGHT DOUBLE QUOTATION MARK
408 #x2018 ;; 212:LEFT SINGLE QUOTATION MARK
409 #x2019 ;; 213:RIGHT SINGLE QUOTATION MARK
410 #x00F7 ;; 214:DIVISION SIGN
411 #x25CA ;; 215:LOZENGE
412 #x00FF ;; 216:LATIN SMALL LETTER Y WITH DIAERESIS
413 #x0178 ;; 217:LATIN CAPITAL LETTER Y WITH DIAERESIS
414 #x2044 ;; 218:FRACTION SLASH
415 #x20AC ;; 219:EURO SIGN
416 #x2039 ;; 220:SINGLE LEFT-POINTING ANGLE QUOTATION MARK
417 #x203A ;; 221:SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
418 #xFB01 ;; 222:LATIN SMALL LIGATURE FI
419 #xFB02 ;; 223:LATIN SMALL LIGATURE FL
420 #x2021 ;; 224:DOUBLE DAGGER
421 #x00B7 ;; 225:MIDDLE DOT
422 #x201A ;; 226:SINGLE LOW-9 QUOTATION MARK
423 #x201E ;; 227:DOUBLE LOW-9 QUOTATION MARK
424 #x2030 ;; 228:PER MILLE SIGN
425 #x00C2 ;; 229:LATIN CAPITAL LETTER A WITH CIRCUMFLEX
426 #x00CA ;; 230:LATIN CAPITAL LETTER E WITH CIRCUMFLEX
427 #x00C1 ;; 231:LATIN CAPITAL LETTER A WITH ACUTE
428 #x00CB ;; 232:LATIN CAPITAL LETTER E WITH DIAERESIS
429 #x00C8 ;; 233:LATIN CAPITAL LETTER E WITH GRAVE
430 #x00CD ;; 234:LATIN CAPITAL LETTER I WITH ACUTE
431 #x00CE ;; 235:LATIN CAPITAL LETTER I WITH CIRCUMFLEX
432 #x00CF ;; 236:LATIN CAPITAL LETTER I WITH DIAERESIS
433 #x00CC ;; 237:LATIN CAPITAL LETTER I WITH GRAVE
434 #x00D3 ;; 238:LATIN CAPITAL LETTER O WITH ACUTE
435 #x00D4 ;; 239:LATIN CAPITAL LETTER O WITH CIRCUMFLEX
436 #xF8FF ;; 240:Apple logo
437 #x00D2 ;; 241:LATIN CAPITAL LETTER O WITH GRAVE
438 #x00DA ;; 242:LATIN CAPITAL LETTER U WITH ACUTE
439 #x00DB ;; 243:LATIN CAPITAL LETTER U WITH CIRCUMFLEX
440 #x00D9 ;; 244:LATIN CAPITAL LETTER U WITH GRAVE
441 #x0131 ;; 245:LATIN SMALL LETTER DOTLESS I
442 #x02C6 ;; 246:MODIFIER LETTER CIRCUMFLEX ACCENT
443 #x02DC ;; 247:SMALL TILDE
444 #x00AF ;; 248:MACRON
445 #x02D8 ;; 249:BREVE
446 #x02D9 ;; 250:DOT ABOVE
447 #x02DA ;; 251:RING ABOVE
448 #x00B8 ;; 252:CEDILLA
449 #x02DD ;; 253:DOUBLE ACUTE ACCENT
450 #x02DB ;; 254:OGONEK
451 #x02C7 ;; 255:CARON
452 ])
453 translation-table)
454 (while (< i 128)
455 (aset encoding-vector i i)
456 (setq i (1+ i)))
457 (while (< i 256)
458 (aset encoding-vector i
459 (decode-char 'ucs (aref vec (- i 128))))
460 (setq i (1+ i)))
461 (setq translation-table
462 (make-translation-table-from-vector encoding-vector))
463 (define-translation-table 'mac-roman-decoder translation-table)
464 (define-translation-table 'mac-roman-encoder
465 (char-table-extra-slot translation-table 0)))
466
467 (define-ccl-program decode-mac-roman
468 `(4
469 ((loop
470 (read r1)
471 (if (r1 < 128) ;; ASCII
472 (r0 = ,(charset-id 'ascii))
473 (if (r1 < 160)
474 (r0 = ,(charset-id 'eight-bit-control))
475 (r0 = ,(charset-id 'eight-bit-graphic))))
476 (translate-character mac-roman-decoder r0 r1)
477 (write-multibyte-character r0 r1)
478 (repeat))))
479 "CCL program to decode Mac Roman")
480
481 (define-ccl-program encode-mac-roman
482 `(1
483 ((loop
484 (read-multibyte-character r0 r1)
485 (translate-character mac-roman-encoder r0 r1)
486 (write-repeat r1))))
487 "CCL program to encode Mac Roman")
488
489 (make-coding-system
490 'mac-roman 4 ?M "Mac Roman Encoding"
491 '(decode-mac-roman . encode-mac-roman)
492 '((safe-chars . mac-roman-encoder)
493 (valid-codes (0 . 255))))
494
495 (provide 'european)
496
497 ;;; european.el ends here