(Info-extract-menu-node-name)
[emacs.git] / lisp / language / european.el
blob3dba5ff2882df3685dad2b96ec2118b193d42c54
1 ;;; european.el --- support for European languages -*- coding: iso-2022-7bit; -*-
3 ;; Copyright (C) 1995, 1997, 2001 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
7 ;; Keywords: multilingual, European
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
26 ;;; Commentary:
28 ;; For European scripts, character sets ISO8859-1,2,3,4,9,14,15 are
29 ;; supported.
31 ;;; Code:
33 ;; Latin-1 (ISO-8859-1)
35 (make-coding-system
36 'iso-latin-1 2 ?1
37 "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)."
38 '(ascii latin-iso8859-1 nil nil
39 nil nil nil nil nil nil nil nil nil nil nil t t)
40 '((safe-charsets ascii latin-iso8859-1)
41 (mime-charset . iso-8859-1)))
43 (define-coding-system-alias 'iso-8859-1 'iso-latin-1)
44 (define-coding-system-alias 'latin-1 'iso-latin-1)
46 (set-language-info-alist
47 "Latin-1" '((charset ascii latin-iso8859-1)
48 (coding-system iso-latin-1)
49 (coding-priority iso-latin-1)
50 (nonascii-translation . latin-iso8859-1)
51 (unibyte-syntax . "latin-1")
52 (unibyte-display . iso-latin-1)
53 (input-method . "latin-1-prefix")
54 (sample-text
55 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
56 (documentation . "\
57 This language environment is a generic one for the Latin-1 (ISO-8859-1)
58 character set which supports the following European languages:
59 Albanian, Basque, Breton, Catalan, Danish, Dutch, English, Faeroese,
60 Finnish, French (with restrictions -- see Latin-9), Frisian, Galician,
61 German, Greenlandic, Icelandic, Irish Gaelic (new orthography),
62 Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic,
63 Scottish Gaelic, Spanish, and Swedish.
64 We also have specific language environments for the following languages:
65 For Dutch, \"Dutch\".
66 For German, \"German\".
67 For French, \"French\".
68 For Italian, \"Italian\".
69 For Slovenian, \"Slovenian\".
70 For Spanish, \"Spanish\".
72 Latin-1 also covers several written languages outside Europe, including
73 Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
74 '("European"))
77 ;; Latin-2 (ISO-8859-2)
79 (make-coding-system
80 'iso-latin-2 2 ?2
81 "ISO 2022 based 8-bit encoding for Latin-2 (MIME:ISO-8859-2)."
82 '(ascii latin-iso8859-2 nil nil
83 nil nil nil nil nil nil nil nil nil nil nil t)
84 '((safe-charsets ascii latin-iso8859-2)
85 (mime-charset . iso-8859-2)))
87 (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
88 (define-coding-system-alias 'latin-2 'iso-latin-2)
90 (set-language-info-alist
91 "Latin-2" '((charset ascii latin-iso8859-2)
92 (coding-system iso-latin-2)
93 (coding-priority iso-latin-2)
94 (nonascii-translation . latin-iso8859-2)
95 (unibyte-syntax . "latin-2")
96 (unibyte-display . iso-latin-2)
97 (input-method . "latin-2-prefix")
98 (documentation . "\
99 This language environment is a generic one for the Latin-2 (ISO-8859-2)
100 character set which supports the following languages:
101 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
102 Serbo-Croatian or Croatian, Slovak, Slovene, Sorbian (upper and lower),
103 and Swedish.
104 We also have specific language environments for the following languages:
105 For Czech, \"Czech\".
106 For Croatian, \"Croatian\".
107 For Romanian, \"Romanian\".
108 For Slovak, \"Slovak\"."))
109 '("European"))
112 ;; Latin-3 (ISO-8859-3)
114 (make-coding-system
115 'iso-latin-3 2 ?3
116 "ISO 2022 based 8-bit encoding for Latin-3 (MIME:ISO-8859-3)."
117 '(ascii latin-iso8859-3 nil nil
118 nil nil nil nil nil nil nil nil nil nil nil t)
119 '((safe-charsets ascii latin-iso8859-3)
120 (mime-charset . iso-8859-3)))
122 (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
123 (define-coding-system-alias 'latin-3 'iso-latin-3)
125 (set-language-info-alist
126 "Latin-3" '((charset ascii latin-iso8859-3)
127 (coding-system iso-latin-3)
128 (coding-priority iso-latin-3)
129 (nonascii-translation . latin-iso8859-3)
130 (unibyte-syntax . "latin-3")
131 (unibyte-display . iso-latin-3)
132 (input-method . "latin-3-prefix")
133 (documentation . "\
134 These languages are supported with the Latin-3 (ISO-8859-3) character set:
135 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
136 German, Italian, Maltese, Spanish, and Turkish."))
137 '("European"))
140 ;; Latin-4 (ISO-8859-4)
142 (make-coding-system
143 'iso-latin-4 2 ?4
144 "ISO 2022 based 8-bit encoding for Latin-4 (MIME:ISO-8859-4)."
145 '(ascii latin-iso8859-4 nil nil
146 nil nil nil nil nil nil nil nil nil nil nil t)
147 '((safe-charsets ascii latin-iso8859-4)
148 (mime-charset . iso-8859-4)))
150 (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
151 (define-coding-system-alias 'latin-4 'iso-latin-4)
153 (set-language-info-alist
154 "Latin-4" '((charset ascii latin-iso8859-4)
155 (coding-system iso-8859-4)
156 (coding-priority iso-8859-4)
157 (nonascii-translation . latin-iso8859-4)
158 (unibyte-syntax . "latin-4")
159 (unibyte-display . iso-8859-4)
160 (input-method . "latin-4-postfix")
161 (documentation . "\
162 These languages are supported with the Latin-4 (ISO-8859-4) character set:
163 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
164 Latvian, Lithuanian, and Norwegian."))
165 '("European"))
168 ;; Latin-5 (ISO-8859-9)
170 (make-coding-system
171 'iso-latin-5 2 ?9
172 "ISO 2022 based 8-bit encoding for Latin-5 (MIME:ISO-8859-9)."
173 '(ascii latin-iso8859-9 nil nil
174 nil nil nil nil nil nil nil nil nil nil nil t)
175 '((safe-charsets ascii latin-iso8859-9)
176 (mime-charset . iso-8859-9)))
178 (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
179 (define-coding-system-alias 'latin-5 'iso-latin-5)
181 (set-language-info-alist
182 "Latin-5" '((charset ascii latin-iso8859-9)
183 (coding-system iso-latin-5)
184 (coding-priority iso-latin-5)
185 (nonascii-translation . latin-iso8859-9)
186 (unibyte-syntax . "latin-5")
187 (unibyte-display . iso-latin-5)
188 (input-method . "latin-5-postfix")
189 (documentation . "Support for Turkish language."))
190 '("European"))
193 ;; Latin-8 (ISO-8859-14)
195 (make-coding-system
196 'iso-latin-8 2 ?W ; `W' for `Welsh', since `C'
197 ; for `Celtic' is taken.
198 "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)."
199 '(ascii latin-iso8859-14 nil nil
200 nil nil nil nil nil nil nil nil nil nil nil t t)
201 '((safe-charsets ascii latin-iso8859-14)
202 (mime-charset . iso-8859-14)))
204 (define-coding-system-alias 'iso-8859-14 'iso-latin-8)
205 (define-coding-system-alias 'latin-8 'iso-latin-8)
207 (set-language-info-alist
208 "Latin-8" '((charset ascii latin-iso8859-14)
209 (coding-system iso-latin-8)
210 (coding-priority iso-latin-8)
211 (nonascii-translation . latin-iso8859-14)
212 (unibyte-syntax . "latin-8")
213 (unibyte-display . iso-latin-8)
214 (input-method . "latin-8-prefix")
215 ;; Fixme: Welsh/Ga{e}lic greetings
216 (sample-text . "\e,_"\e(B \e,_p\e(B \e,_^\e(B")
217 (documentation . "\
218 This language environment is a generic one for the Latin-8 (ISO-8859-14)
219 character set which supports the Celtic languages, including those not
220 covered by other ISO-8859 character sets:
221 Welsh, Manx Gaelic and Irish Gaelic (old orthography)."))
222 '("European"))
224 ;; Latin-9 (ISO-8859-15)
226 (make-coding-system
227 'iso-latin-9 2 ?0 ; `0' for `Latin-0'
228 "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)."
229 '(ascii latin-iso8859-15 nil nil
230 nil nil nil nil nil nil nil nil nil nil nil t t)
231 '((safe-charsets ascii latin-iso8859-15)
232 (mime-charset . iso-8859-15)))
234 (define-coding-system-alias 'iso-8859-15 'iso-latin-9)
235 (define-coding-system-alias 'latin-9 'iso-latin-9)
236 (define-coding-system-alias 'latin-0 'iso-latin-9)
238 (set-language-info-alist
239 "Latin-9" '((charset ascii latin-iso8859-15)
240 (coding-system iso-latin-9)
241 (coding-priority iso-latin-9)
242 (nonascii-translation . latin-iso8859-15)
243 (unibyte-syntax . "latin-9")
244 (unibyte-display . iso-latin-9)
245 (input-method . "latin-9-prefix")
246 (sample-text
247 . "AVE. \e,b&(48<=>\e(B \e,b$\e(B")
248 (documentation . "\
249 This language environment is a generic one for the Latin-9 (ISO-8859-15)
250 character set which supports the same languages as Latin-1 with the
251 addition of the Euro sign and some additional French and Finnish letters.
252 Latin-9 is sometimes nicknamed `Latin-0'."))
253 '("European"))
255 (set-language-info-alist
256 "Dutch" '((tutorial . "TUTORIAL.nl")
257 (charset ascii latin-iso8859-1)
258 (coding-system iso-latin-1 iso-latin-9)
259 (coding-priority iso-latin-1)
260 (nonascii-translation . latin-iso8859-1)
261 (unibyte-syntax . "latin-1")
262 (unibyte-display . iso-latin-1)
263 (input-method . "dutch")
264 (sample-text . "Er is een aantal manieren waarop je dit kan doen")
265 (documentation . "\
266 This language environment is almost the same as Latin-1,
267 but it selects the Dutch tutorial and input method."))
268 '("European"))
270 (set-language-info-alist
271 "German" '((tutorial . "TUTORIAL.de")
272 (charset ascii latin-iso8859-1)
273 (coding-system iso-latin-1 iso-latin-9)
274 (coding-priority iso-latin-1)
275 (input-method . "german-postfix")
276 (nonascii-translation . latin-iso8859-1)
277 (unibyte-syntax . "latin-1")
278 (unibyte-display . iso-latin-1)
279 (sample-text . "\
280 German (Deutsch Nord) Guten Tag
281 German (Deutsch S\e,A|\e(Bd) Gr\e,A|_\e(B Gott")
282 (documentation . "\
283 This language environment is almost the same as Latin-1,
284 but sets the default input method to \"german-postfix\".
285 Additionally, it selects the German tutorial."))
286 '("European"))
288 (set-language-info-alist
289 "French" '((tutorial . "TUTORIAL.fr")
290 (charset ascii latin-iso8859-1)
291 (coding-system iso-latin-1 iso-latin-9)
292 (coding-priority iso-latin-1)
293 (nonascii-translation . latin-iso8859-1)
294 (unibyte-syntax . "latin-1")
295 (unibyte-display . iso-latin-1)
296 (input-method . "latin-1-prefix")
297 (sample-text . "French (Fran\e,Ag\e(Bais) Bonjour, Salut")
298 (documentation . "\
299 This language environment is almost the same as Latin-1,
300 but it selects the French tutorial and input method."))
301 '("European"))
303 (set-language-info-alist
304 "Italian" '((tutorial . "TUTORIAL.it")
305 (charset ascii latin-iso8859-1)
306 (coding-system iso-latin-1 iso-latin-9)
307 (coding-priority iso-latin-1)
308 (nonascii-translation . latin-iso8859-1)
309 (unibyte-syntax . "latin-1")
310 (unibyte-display . iso-latin-1)
311 (input-method . "italian-postfix")
312 (sample-text . "Salve, ciao!")
313 (documentation . "\
314 This language environment is almost the same as Latin-1,
315 but sets the default input method to \"italian-postfix\".
316 Additionally, it selects the Italian tutorial."))
317 '("European"))
319 (set-language-info-alist
320 "Slovenian" '((charset . (ascii latin-iso8859-2))
321 (coding-system . (iso-8859-2))
322 (coding-priority . (iso-8859-2))
323 (nonascii-translation . latin-iso8859-2)
324 (input-method . "slovenian")
325 (unibyte-syntax . "latin-2")
326 (unibyte-display . iso-8859-2)
327 (tutorial . "TUTORIAL.sl")
328 (sample-text . "\e,B.\e(Belimo vam uspe\e,B9\e(Ben dan!")
329 (documentation . "\
330 This language environment is almost the same as Latin-2,
331 but it selects the Slovenian tutorial and input method."))
332 '("European"))
334 (set-language-info-alist
335 "Spanish" '((tutorial . "TUTORIAL.es")
336 (charset ascii latin-iso8859-1)
337 (coding-system iso-latin-1 iso-latin-9)
338 (coding-priority iso-latin-1)
339 (input-method . "spanish-postfix")
340 (nonascii-translation . latin-iso8859-1)
341 (unibyte-syntax . "latin-1")
342 (unibyte-display . iso-latin-1)
343 (sample-text . "Spanish (Espa\e,Aq\e(Bol) \e,A!\e(BHola!")
344 (documentation . "\
345 This language environment is almost the same as Latin-1,
346 but it sets the default input method to \"spanish-postfix\",
347 and it selects the Spanish tutorial."))
348 '("European"))
350 ;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
351 ;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
352 ;; was used for Turkish. Those who use Latin-3 for Turkish should use
353 ;; "Latin-3" language environment.
355 (set-language-info-alist
356 "Turkish" '((charset ascii latin-iso8859-9)
357 (coding-system iso-latin-5 iso-latin-3)
358 (coding-priority iso-latin-5)
359 (nonascii-translation . latin-iso8859-9)
360 (unibyte-syntax . "latin-5")
361 (unibyte-display . iso-latin-5)
362 (input-method . "turkish-postfix")
363 (sample-text . "Turkish (T\e,M|\e(Brk\e,Mg\e(Be) Merhaba")
364 (documentation . t)))
366 ;; Polish ISO 8859-2 environment.
367 ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
368 ;; Keywords: multilingual, Polish
370 (set-language-info-alist
371 "Polish" '((charset . (ascii latin-iso8859-2))
372 (coding-system . (iso-8859-2))
373 (coding-priority . (iso-8859-2))
374 (input-method . "polish-slash")
375 (nonascii-translation . latin-iso8859-2)
376 (unibyte-syntax . "latin-2")
377 (unibyte-display . iso-8859-2)
378 (tutorial . "TUTORIAL.pl")
379 (sample-text . "P\e,Bs\e(Bjd\e,B<\e(B, ki\e,Bq\e(B-\e,B?\e(Be t\e,Bj\e(B chmurno\e,B6f\e(B w g\e,B31\e(Bb flaszy")
380 (documentation . t))
381 '("European"))
383 (set-language-info-alist
384 "Welsh" `((coding-system utf-8 latin-8) ; the input method is Unicode-based
385 (coding-priority utf-8 latin-8)
386 (nonascii-translation . latin-iso8859-14)
387 (input-method . "welsh")
388 (documentation . "Support for Welsh, using Unicode."))
389 '("European"))
391 (set-language-info-alist
392 "Latin-6" `((coding-system latin-6)
393 (coding-priority latin-6)
394 (nonascii-translation . ,(get 'decode-iso-latin-6 'translation-table))
395 (input-method . latin-pre)
396 (input-method . latin-pre)
397 (features code-pages)
398 (documentation . "Support for Latin-6."))
399 '("European"))
401 (set-language-info-alist
402 "Latin-7" `((coding-system latin-7)
403 (coding-priority latin-7)
404 (nonascii-translation . ,(get 'decode-iso-latin-7
405 'translation-table))
406 (input-method . latin-pre)
407 (features code-pages)
408 (documentation . "Support for Latin-7, e.g. Latvian, Lithuanian."))
409 '("European"))
411 (set-language-info-alist
412 "Lithuanian" `((coding-system latin-7)
413 (coding-priority latin-7)
414 (input-method . "lithuanian-keyboard")
415 (nonascii-translation . ,(get 'decode-iso-latin-7
416 'translation-table))
417 (features code-pages)
418 (documentation . "Support for Lithuanian."))
419 '("European"))
421 (set-language-info-alist
422 "Latvian" `((coding-system latin-7)
423 (coding-priority latin-7)
424 (input-method . "latvian-keyboard")
425 (nonascii-translation . ,(get 'decode-iso-latin-7
426 'translation-table))
427 (features code-pages)
428 (documentation . "Support for Latvian."))
429 '("European"))
431 (set-language-info-alist
432 "Swedish" '((tutorial . "TUTORIAL.sv")
433 (charset ascii latin-iso8859-1)
434 (coding-system iso-latin-1)
435 (coding-priority iso-latin-1)
436 (nonascii-translation . latin-iso8859-1)
437 (unibyte-syntax . "latin-1")
438 (unibyte-display . iso-latin-1)
439 (sample-text . "Goddag Hej")
440 (documentation . "Support for Swedish"))
441 '("European"))
443 (set-language-info-alist
444 "Croatian" '((charset . (ascii latin-iso8859-2))
445 (coding-system . (iso-8859-2))
446 (coding-priority . (iso-8859-2))
447 (input-method . "croatian")
448 (nonascii-translation . latin-iso8859-2)
449 (unibyte-syntax . "latin-2")
450 (unibyte-display . iso-8859-2)
451 (documentation . "Support for Croatian with Latin-2 encoding."))
452 '("European"))
454 ;; Definitions for the Mac Roman character sets and coding system.
455 ;; The Mac Roman encoding uses all 128 code points in the range 128 to
456 ;; 255 for actual characters. Emacs decodes them to one of the
457 ;; following character sets.
458 ;; ascii, latin-iso8859-1, mule-unicode-0100-24ff,
459 ;; mule-unicode-2500-33ff, mule-unicode-e000-ffff
461 (let
462 ((encoding-vector (make-vector 256 nil))
463 (i 0)
464 (vec ;; mac-roman (128..255) -> UCS mapping
465 [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS
466 #x00C5 ;; 129:LATIN CAPITAL LETTER A WITH RING ABOVE
467 #x00C7 ;; 130:LATIN CAPITAL LETTER C WITH CEDILLA
468 #x00C9 ;; 131:LATIN CAPITAL LETTER E WITH ACUTE
469 #x00D1 ;; 132:LATIN CAPITAL LETTER N WITH TILDE
470 #x00D6 ;; 133:LATIN CAPITAL LETTER O WITH DIAERESIS
471 #x00DC ;; 134:LATIN CAPITAL LETTER U WITH DIAERESIS
472 #x00E1 ;; 135:LATIN SMALL LETTER A WITH ACUTE
473 #x00E0 ;; 136:LATIN SMALL LETTER A WITH GRAVE
474 #x00E2 ;; 137:LATIN SMALL LETTER A WITH CIRCUMFLEX
475 #x00E4 ;; 138:LATIN SMALL LETTER A WITH DIAERESIS
476 #x00E3 ;; 139:LATIN SMALL LETTER A WITH TILDE
477 #x00E5 ;; 140:LATIN SMALL LETTER A WITH RING ABOVE
478 #x00E7 ;; 141:LATIN SMALL LETTER C WITH CEDILLA
479 #x00E9 ;; 142:LATIN SMALL LETTER E WITH ACUTE
480 #x00E8 ;; 143:LATIN SMALL LETTER E WITH GRAVE
481 #x00EA ;; 144:LATIN SMALL LETTER E WITH CIRCUMFLEX
482 #x00EB ;; 145:LATIN SMALL LETTER E WITH DIAERESIS
483 #x00ED ;; 146:LATIN SMALL LETTER I WITH ACUTE
484 #x00EC ;; 147:LATIN SMALL LETTER I WITH GRAVE
485 #x00EE ;; 148:LATIN SMALL LETTER I WITH CIRCUMFLEX
486 #x00EF ;; 149:LATIN SMALL LETTER I WITH DIAERESIS
487 #x00F1 ;; 150:LATIN SMALL LETTER N WITH TILDE
488 #x00F3 ;; 151:LATIN SMALL LETTER O WITH ACUTE
489 #x00F2 ;; 152:LATIN SMALL LETTER O WITH GRAVE
490 #x00F4 ;; 153:LATIN SMALL LETTER O WITH CIRCUMFLEX
491 #x00F6 ;; 154:LATIN SMALL LETTER O WITH DIAERESIS
492 #x00F5 ;; 155:LATIN SMALL LETTER O WITH TILDE
493 #x00FA ;; 156:LATIN SMALL LETTER U WITH ACUTE
494 #x00F9 ;; 157:LATIN SMALL LETTER U WITH GRAVE
495 #x00FB ;; 158:LATIN SMALL LETTER U WITH CIRCUMFLEX
496 #x00FC ;; 159:LATIN SMALL LETTER U WITH DIAERESIS
497 #x2020 ;; 160:DAGGER
498 #x00B0 ;; 161:DEGREE SIGN
499 #x00A2 ;; 162:CENT SIGN
500 #x00A3 ;; 163:POUND SIGN
501 #x00A7 ;; 164:SECTION SIGN
502 #x2022 ;; 165:BULLET
503 #x00B6 ;; 166:PILCROW SIGN
504 #x00DF ;; 167:LATIN SMALL LETTER SHARP S
505 #x00AE ;; 168:REGISTERED SIGN
506 #x00A9 ;; 169:COPYRIGHT SIGN
507 #x2122 ;; 170:TRADE MARK SIGN
508 #x00B4 ;; 171:ACUTE ACCENT
509 #x00A8 ;; 172:DIAERESIS
510 #x2260 ;; 173:NOT EQUAL TO
511 #x00C6 ;; 174:LATIN CAPITAL LETTER AE
512 #x00D8 ;; 175:LATIN CAPITAL LETTER O WITH STROKE
513 #x221E ;; 176:INFINITY
514 #x00B1 ;; 177:PLUS-MINUS SIGN
515 #x2264 ;; 178:LESS-THAN OR EQUAL TO
516 #x2265 ;; 179:GREATER-THAN OR EQUAL TO
517 #x00A5 ;; 180:YEN SIGN
518 #x00B5 ;; 181:MICRO SIGN
519 #x2202 ;; 182:PARTIAL DIFFERENTIAL
520 #x2211 ;; 183:N-ARY SUMMATION
521 #x220F ;; 184:N-ARY PRODUCT
522 #x03C0 ;; 185:GREEK SMALL LETTER PI
523 #x222B ;; 186:INTEGRAL
524 #x00AA ;; 187:FEMININE ORDINAL INDICATOR
525 #x00BA ;; 188:MASCULINE ORDINAL INDICATOR
526 #x03A9 ;; 189:GREEK CAPITAL LETTER OMEGA
527 #x00E6 ;; 190:LATIN SMALL LETTER AE
528 #x00F8 ;; 191:LATIN SMALL LETTER O WITH STROKE
529 #x00BF ;; 192:INVERTED QUESTION MARK
530 #x00A1 ;; 193:INVERTED EXCLAMATION MARK
531 #x00AC ;; 194:NOT SIGN
532 #x221A ;; 195:SQUARE ROOT
533 #x0192 ;; 196:LATIN SMALL LETTER F WITH HOOK
534 #x2248 ;; 197:ALMOST EQUAL TO
535 #x2206 ;; 198:INCREMENT
536 #x00AB ;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
537 #x00BB ;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
538 #x2026 ;; 201:HORIZONTAL ELLIPSIS
539 #x00A0 ;; 202:NO-BREAK SPACE
540 #x00C0 ;; 203:LATIN CAPITAL LETTER A WITH GRAVE
541 #x00C3 ;; 204:LATIN CAPITAL LETTER A WITH TILDE
542 #x00D5 ;; 205:LATIN CAPITAL LETTER O WITH TILDE
543 #x0152 ;; 206:LATIN CAPITAL LIGATURE OE
544 #x0153 ;; 207:LATIN SMALL LIGATURE OE
545 #x2013 ;; 208:EN DASH
546 #x2014 ;; 209:EM DASH
547 #x201C ;; 210:LEFT DOUBLE QUOTATION MARK
548 #x201D ;; 211:RIGHT DOUBLE QUOTATION MARK
549 #x2018 ;; 212:LEFT SINGLE QUOTATION MARK
550 #x2019 ;; 213:RIGHT SINGLE QUOTATION MARK
551 #x00F7 ;; 214:DIVISION SIGN
552 #x25CA ;; 215:LOZENGE
553 #x00FF ;; 216:LATIN SMALL LETTER Y WITH DIAERESIS
554 #x0178 ;; 217:LATIN CAPITAL LETTER Y WITH DIAERESIS
555 #x2044 ;; 218:FRACTION SLASH
556 #x20AC ;; 219:EURO SIGN
557 #x2039 ;; 220:SINGLE LEFT-POINTING ANGLE QUOTATION MARK
558 #x203A ;; 221:SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
559 #xFB01 ;; 222:LATIN SMALL LIGATURE FI
560 #xFB02 ;; 223:LATIN SMALL LIGATURE FL
561 #x2021 ;; 224:DOUBLE DAGGER
562 #x00B7 ;; 225:MIDDLE DOT
563 #x201A ;; 226:SINGLE LOW-9 QUOTATION MARK
564 #x201E ;; 227:DOUBLE LOW-9 QUOTATION MARK
565 #x2030 ;; 228:PER MILLE SIGN
566 #x00C2 ;; 229:LATIN CAPITAL LETTER A WITH CIRCUMFLEX
567 #x00CA ;; 230:LATIN CAPITAL LETTER E WITH CIRCUMFLEX
568 #x00C1 ;; 231:LATIN CAPITAL LETTER A WITH ACUTE
569 #x00CB ;; 232:LATIN CAPITAL LETTER E WITH DIAERESIS
570 #x00C8 ;; 233:LATIN CAPITAL LETTER E WITH GRAVE
571 #x00CD ;; 234:LATIN CAPITAL LETTER I WITH ACUTE
572 #x00CE ;; 235:LATIN CAPITAL LETTER I WITH CIRCUMFLEX
573 #x00CF ;; 236:LATIN CAPITAL LETTER I WITH DIAERESIS
574 #x00CC ;; 237:LATIN CAPITAL LETTER I WITH GRAVE
575 #x00D3 ;; 238:LATIN CAPITAL LETTER O WITH ACUTE
576 #x00D4 ;; 239:LATIN CAPITAL LETTER O WITH CIRCUMFLEX
577 #xF8FF ;; 240:Apple logo
578 #x00D2 ;; 241:LATIN CAPITAL LETTER O WITH GRAVE
579 #x00DA ;; 242:LATIN CAPITAL LETTER U WITH ACUTE
580 #x00DB ;; 243:LATIN CAPITAL LETTER U WITH CIRCUMFLEX
581 #x00D9 ;; 244:LATIN CAPITAL LETTER U WITH GRAVE
582 #x0131 ;; 245:LATIN SMALL LETTER DOTLESS I
583 #x02C6 ;; 246:MODIFIER LETTER CIRCUMFLEX ACCENT
584 #x02DC ;; 247:SMALL TILDE
585 #x00AF ;; 248:MACRON
586 #x02D8 ;; 249:BREVE
587 #x02D9 ;; 250:DOT ABOVE
588 #x02DA ;; 251:RING ABOVE
589 #x00B8 ;; 252:CEDILLA
590 #x02DD ;; 253:DOUBLE ACUTE ACCENT
591 #x02DB ;; 254:OGONEK
592 #x02C7 ;; 255:CARON
594 translation-table)
595 (while (< i 128)
596 (aset encoding-vector i i)
597 (setq i (1+ i)))
598 (while (< i 256)
599 (aset encoding-vector i
600 (decode-char 'ucs (aref vec (- i 128))))
601 (setq i (1+ i)))
602 (setq translation-table
603 (make-translation-table-from-vector encoding-vector))
604 (define-translation-table 'mac-roman-decoder translation-table)
605 (define-translation-table 'mac-roman-encoder
606 (char-table-extra-slot translation-table 0)))
608 (define-ccl-program decode-mac-roman
610 ((loop
611 (read r1)
612 (if (r1 < 128) ;; ASCII
613 (r0 = ,(charset-id 'ascii))
614 (if (r1 < 160)
615 (r0 = ,(charset-id 'eight-bit-control))
616 (r0 = ,(charset-id 'eight-bit-graphic))))
617 (translate-character mac-roman-decoder r0 r1)
618 (write-multibyte-character r0 r1)
619 (repeat))))
620 "CCL program to decode Mac Roman")
622 (define-ccl-program encode-mac-roman
624 ((loop
625 (read-multibyte-character r0 r1)
626 (translate-character ucs-mule-to-mule-unicode r0 r1)
627 (translate-character mac-roman-encoder r0 r1)
628 (if (r0 != ,(charset-id 'ascii))
629 (if (r0 != ,(charset-id 'eight-bit-graphic))
630 (if (r0 != ,(charset-id 'eight-bit-control))
631 (r1 = ??))))
632 (write-repeat r1))))
633 "CCL program to encode Mac Roman")
635 (make-coding-system
636 'mac-roman 4 ?M
637 "Mac Roman Encoding (MIME:MACINTOSH)."
638 '(decode-mac-roman . encode-mac-roman)
639 (list (cons 'safe-chars (get 'mac-roman-encoder 'translation-table))
640 '(valid-codes (0 . 255))
641 '(mime-charset . macintosh))) ; per IANA, rfc1345
643 (defconst diacritic-composition-pattern "\\C^\\c^+")
645 (defun diacritic-compose-region (beg end)
646 "Compose diacritic characters in the region.
647 When called from a program, expects two arguments,
648 positions (integers or markers) specifying the region."
649 (interactive "r")
650 (save-restriction
651 (narrow-to-region beg end)
652 (goto-char (point-min))
653 (while (re-search-forward diacritic-composition-pattern nil t)
654 (compose-region (match-beginning 0) (match-end 0)))))
656 (defun diacritic-compose-string (string)
657 "Compose diacritic characters in STRING and return the resulting string."
658 (let ((idx 0))
659 (while (setq idx (string-match diacritic-composition-pattern string idx))
660 (compose-string string idx (match-end 0))
661 (setq idx (match-end 0))))
662 string)
664 (defun diacritic-compose-buffer ()
665 "Compose diacritic characters in the current buffer."
666 (interactive)
667 (diacritic-compose-region (point-min) (point-max)))
669 (defun diacritic-post-read-conversion (len)
670 (diacritic-compose-region (point) (+ (point) len))
671 len)
673 (defun diacritic-composition-function (from to pattern &optional string)
674 "Compose diacritic text in the region FROM and TO.
675 The text matches the regular expression PATTERN.
676 Optional 4th argument STRING, if non-nil, is a string containing text
677 to compose.
679 The return value is the number of composed characters."
680 (when (< (1+ from) to)
681 (if string
682 (compose-string string from to)
683 (compose-region from to))
684 (- to from)))
686 ;; Register a function to compose Unicode diacrtics and marks.
687 (let ((patterns '(("\\C^\\c^+" . diacritic-composition-function))))
688 (let ((c #x300))
689 (while (<= c #x362)
690 (aset composition-function-table (decode-char 'ucs c) patterns)
691 (setq c (1+ c)))
692 (setq c #x20d0)
693 (while (<= c #x20e3)
694 (aset composition-function-table (decode-char 'ucs c) patterns)
695 (setq c (1+ c)))))
697 (provide 'european)
699 ;;; european.el ends here