(bootstrap-prepare): Also chmod cal-loaddefs.el.
[emacs.git] / lisp / language / european.el
blobda3ae2b44ef0f0ca953f9d483c0417d919798007
1 ;;; european.el --- support for European languages -*- coding: iso-2022-7bit; -*-
3 ;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 ;; 2008 Free Software Foundation, Inc.
5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6 ;; 2005, 2006, 2007, 2008
7 ;; National Institute of Advanced Industrial Science and Technology (AIST)
8 ;; Registration Number H14PRO021
9 ;; Copyright (C) 2003
10 ;; National Institute of Advanced Industrial Science and Technology (AIST)
11 ;; Registration Number H13PRO009
13 ;; Keywords: multilingual, European
15 ;; This file is part of GNU Emacs.
17 ;; GNU Emacs is free software; you can redistribute it and/or modify
18 ;; it under the terms of the GNU General Public License as published by
19 ;; the Free Software Foundation; either version 3, or (at your option)
20 ;; any later version.
22 ;; GNU Emacs is distributed in the hope that it will be useful,
23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;; GNU General Public License for more details.
27 ;; You should have received a copy of the GNU General Public License
28 ;; along with GNU Emacs; see the file COPYING. If not, write to the
29 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
30 ;; Boston, MA 02110-1301, USA.
32 ;;; Commentary:
34 ;; For European scripts, all the ISO Latin character sets are
35 ;; supported, along with various others.
37 ;;; Code:
39 ;; Latin-1 (ISO-8859-1)
41 (set-language-info-alist
42 "Latin-1" '((charset iso-8859-1)
43 (coding-system iso-latin-1 iso-latin-9 windows-1252)
44 (coding-priority iso-latin-1)
45 (nonascii-translation . iso-8859-1)
46 (unibyte-display . iso-latin-1)
47 (input-method . "latin-1-prefix")
48 (sample-text
49 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e$(D+d)N\e(B Gott, Ciao, \e$(D"B\e(BHola!")
50 (documentation . "\
51 This language environment is a generic one for the Latin-1 (ISO-8859-1)
52 character set which supports the following European languages:
53 Albanian, Basque, Breton, Catalan, Danish, Dutch, English, Faeroese,
54 Finnish, French (with restrictions -- see Latin-9), Frisian, Galician,
55 German, Greenlandic, Icelandic, Irish Gaelic (new orthography),
56 Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic,
57 Scottish Gaelic, Spanish, and Swedish.
58 We also have specific language environments for the following languages:
59 For Dutch, \"Dutch\".
60 For German, \"German\".
61 For French, \"French\".
62 For Italian, \"Italian\".
63 For Slovenian, \"Slovenian\".
64 For Spanish, \"Spanish\".
66 Latin-1 also covers several written languages outside Europe, including
67 Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
68 '("European"))
71 ;; Latin-2 (ISO-8859-2)
73 (define-coding-system 'iso-latin-2
74 "ISO 2022 based 8-bit encoding for Latin-2 (MIME:ISO-8859-2)."
75 :coding-type 'charset
76 :mnemonic ?2
77 :charset-list '(iso-8859-2)
78 :mime-charset 'iso-8859-2)
80 (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
81 (define-coding-system-alias 'latin-2 'iso-latin-2)
83 (set-language-info-alist
84 "Latin-2" '((charset iso-8859-2)
85 (coding-system iso-latin-2 windows-1250)
86 (coding-priority iso-latin-2)
87 (nonascii-translation . iso-8859-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 Croatian, \"Croatian\".
99 For Polish, \"Polish\".
100 For Romanian, \"Romanian\".
101 For Slovak, \"Slovak\"."))
102 '("European"))
105 ;; Latin-3 (ISO-8859-3)
107 (define-coding-system 'iso-latin-3
108 "ISO 2022 based 8-bit encoding for Latin-3 (MIME:ISO-8859-3)."
109 :coding-type 'charset
110 :mnemonic ?3
111 :charset-list '(iso-8859-3)
112 :mime-charset 'iso-8859-3)
114 (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
115 (define-coding-system-alias 'latin-3 'iso-latin-3)
117 (set-language-info-alist
118 "Latin-3" '((charset iso-8859-3)
119 (coding-system iso-latin-3)
120 (coding-priority iso-latin-3)
121 (nonascii-translation . iso-8859-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"))
131 ;; Latin-4 (ISO-8859-4)
133 (define-coding-system 'iso-latin-4
134 "ISO 2022 based 8-bit encoding for Latin-4 (MIME:ISO-8859-4)."
135 :coding-type 'charset
136 :mnemonic ?4
137 :charset-list '(iso-8859-4)
138 :mime-charset 'iso-8859-4)
140 (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
141 (define-coding-system-alias 'latin-4 'iso-latin-4)
143 (set-language-info-alist
144 "Latin-4" '((charset iso-8859-4)
145 (coding-system iso-8859-4)
146 (coding-priority iso-8859-4)
147 (nonascii-translation . iso-8859-4)
148 (unibyte-display . iso-8859-4)
149 (input-method . "latin-4-postfix")
150 (documentation . "\
151 These languages are supported with the Latin-4 (ISO-8859-4) character set:
152 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
153 Latvian, Lithuanian, and Norwegian."))
154 '("European"))
157 ;; Latin-5 (ISO-8859-9)
159 (define-coding-system 'iso-latin-5
160 "ISO 2022 based 8-bit encoding for Latin-5 (MIME:ISO-8859-9)."
161 :coding-type 'charset
162 :mnemonic ?9
163 :charset-list '(iso-8859-9)
164 :mime-charset 'iso-8859-9)
166 (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
167 (define-coding-system-alias 'latin-5 'iso-latin-5)
169 (set-language-info-alist
170 "Latin-5" '((charset iso-8859-9)
171 (coding-system iso-latin-5)
172 (coding-priority iso-latin-5)
173 (nonascii-translation . iso-8859-9)
174 (unibyte-display . iso-latin-5)
175 (input-method . "latin-5-postfix")
176 (documentation . "Support for Latin-5.\
177 See also the Turkish environment."))
178 '("European"))
181 ;; Latin-6 (ISO-8859-10)
183 (define-coding-system 'iso-latin-6
184 "ISO 2022 based 8-bit encoding for Latin-6 (MIME:ISO-8859-10)."
185 :coding-type 'charset
186 :mnemonic ?9
187 :charset-list '(iso-8859-10)
188 :mime-charset 'iso-8859-10)
190 (define-coding-system-alias 'iso-8859-10 'iso-latin-6)
191 (define-coding-system-alias 'latin-6 'iso-latin-6)
193 (set-language-info-alist
194 "Latin-6" '((charset iso-8859-10)
195 (coding-system iso-latin-6)
196 (coding-priority iso-latin-6)
197 (nonascii-translation . iso-8859-10)
198 (unibyte-display . iso-latin-6)
199 ;; Fixme: input method.
200 (documentation . "Support for generic Latin-6 (Northern European)."))
201 '("European"))
204 ;; Latin-7 (ISO-8859-13)
206 (define-coding-system 'iso-latin-7
207 "ISO 2022 based 8-bit encoding for Latin-7 (MIME:ISO-8859-13)."
208 :coding-type 'charset
209 :mnemonic ?9
210 :charset-list '(iso-8859-13)
211 :mime-charset 'iso-8859-13)
213 (define-coding-system-alias 'iso-8859-13 'iso-latin-7)
214 (define-coding-system-alias 'latin-7 'iso-latin-7)
216 (set-language-info-alist
217 "Latin-7" '((charset iso-8859-13)
218 (coding-system iso-latin-7)
219 (coding-priority iso-latin-7)
220 (nonascii-translation . iso-8859-13)
221 (unibyte-display . iso-latin-7)
222 ;; Fixme: input method.
223 (documentation . "Support for generic Latin-7 (Baltic Rim)."))
224 '("European"))
226 ;; Latin-8 (ISO-8859-14)
228 (define-coding-system 'iso-latin-8
229 "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)."
230 :coding-type 'charset
231 ;; `W' for `Welsh', since `C' for `Celtic' is taken.
232 :mnemonic ?W
233 :charset-list '(iso-8859-14)
234 :mime-charset 'iso-8859-14)
236 (define-coding-system-alias 'iso-8859-14 'iso-latin-8)
237 (define-coding-system-alias 'latin-8 'iso-latin-8)
239 (set-language-info-alist
240 "Latin-8" '((charset iso-8859-14)
241 (coding-system iso-latin-8)
242 (coding-priority iso-latin-8)
243 (nonascii-translation . iso-8859-14)
244 (unibyte-display . iso-latin-8)
245 (input-method . "latin-8-prefix")
246 ;; Fixme: Welsh/Ga{e}lic greetings
247 (sample-text . "\e,_"\e(B \e$(D+q\e(B \e$(D*t\e(B")
248 (documentation . "\
249 This language environment is a generic one for the Latin-8 (ISO-8859-14)
250 character set which supports the Celtic languages, including those not
251 covered by other ISO-8859 character sets:
252 Welsh, Manx Gaelic and Irish Gaelic (old orthography)."))
253 '("European"))
255 ;; Latin-9 (ISO-8859-15)
257 (define-coding-system 'iso-latin-9
258 "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)."
259 :coding-type 'charset
260 ;; `0' for `Latin-0'
261 :mnemonic ?0
262 :charset-list '(iso-8859-15)
263 :mime-charset 'iso-8859-15)
265 (define-coding-system-alias 'iso-8859-15 'iso-latin-9)
266 (define-coding-system-alias 'latin-9 'iso-latin-9)
267 (define-coding-system-alias 'latin-0 'iso-latin-9)
269 (set-language-info-alist
270 "Latin-9" '((charset iso-8859-15)
271 (coding-system iso-latin-9)
272 (coding-priority iso-latin-9)
273 (nonascii-translation . iso-8859-15)
274 (unibyte-display . iso-latin-9)
275 (input-method . "latin-9-prefix")
276 (sample-text
277 . "AVE. \e$(D*^+^*v+v)-)M*s\e(B \e$(Q)!\e(B")
278 (documentation . "\
279 This language environment is a generic one for the Latin-9 (ISO-8859-15)
280 character set which supports the same languages as Latin-1 with the
281 addition of the Euro sign and some additional French and Finnish letters.
282 Latin-9 is sometimes nicknamed `Latin-0'."))
283 '("European"))
285 (set-language-info-alist
286 "Esperanto" '((tutorial . "TUTORIAL.eo")
287 (charset ascii latin-iso8859-3)
288 (coding-system iso-latin-3)
289 (coding-priority iso-latin-3)
290 (nonascii-translation . latin-iso8859-3)
291 (unibyte-syntax . "latin-3")
292 (unibyte-display . iso-latin-3)
293 (input-method . "latin-3-prefix")
294 (documentation . "Support for Esperanto with ISO-8859-3 character set."))
295 '("European"))
298 (define-coding-system 'windows-1250
299 "windows-1250 (Central European) encoding (MIME: WINDOWS-1250)"
300 :coding-type 'charset
301 :mnemonic ?*
302 :charset-list '(windows-1250)
303 :mime-charset 'windows-1250)
304 (define-coding-system-alias 'cp1250 'windows-1250)
306 (define-coding-system 'windows-1252
307 "windows-1252 (Western European) encoding (MIME: WINDOWS-1252)"
308 :coding-type 'charset
309 :mnemonic ?*
310 :charset-list '(windows-1252)
311 :mime-charset 'windows-1252)
312 (define-coding-system-alias 'cp1252 'windows-1252)
314 (define-coding-system 'windows-1254
315 "windows-1254 (Turkish) encoding (MIME: WINDOWS-1254)"
316 :coding-type 'charset
317 :mnemonic ?*
318 :charset-list '(windows-1254)
319 :mime-charset 'windows-1254)
320 (define-coding-system-alias 'cp1254 'windows-1254)
322 (define-coding-system 'windows-1257
323 "windows-1257 (Baltic) encoding (MIME: WINDOWS-1257)"
324 :coding-type 'charset
325 :mnemonic ?*
326 :charset-list '(windows-1257)
327 :mime-charset 'windows-1257)
328 (define-coding-system-alias 'cp1257 'windows-1257)
330 (define-coding-system 'cp850
331 "DOS codepage 850 (Western European)"
332 :coding-type 'charset
333 :mnemonic ?D
334 :charset-list '(cp850)
335 :mime-charset 'cp850)
336 (define-coding-system-alias 'ibm850 'cp850)
338 (define-coding-system 'cp852
339 "DOS codepage 852 (Slavic)"
340 :coding-type 'charset
341 :mnemonic ?D
342 :charset-list '(cp852)
343 :mime-charset 'cp852)
344 (define-coding-system-alias 'ibm852 'cp852)
346 (define-coding-system 'cp857
347 "DOS codepage 857 (Turkish)"
348 :coding-type 'charset
349 :mnemonic ?D
350 :charset-list '(cp857)
351 :mime-charset 'cp857)
352 (define-coding-system-alias 'ibm857 'cp857)
354 (define-coding-system 'cp858
355 "Codepage 858 (Multilingual Latin I + Euro)"
356 :coding-type 'charset
357 :mnemonic ?D
358 :charset-list '(cp858)
359 :mime-charset 'cp858)
361 (define-coding-system 'cp860
362 "DOS codepage 860 (Portuguese)"
363 :coding-type 'charset
364 :mnemonic ?D
365 :charset-list '(cp860)
366 :mime-charset 'cp860)
367 (define-coding-system-alias 'ibm860 'cp860)
369 (define-coding-system 'cp861
370 "DOS codepage 861 (Icelandic)"
371 :coding-type 'charset
372 :mnemonic ?D
373 :charset-list '(cp861)
374 :mime-charset 'cp861)
375 (define-coding-system-alias 'ibm861 'cp861)
377 (define-coding-system 'cp863
378 "DOS codepage 863 (French Canadian)"
379 :coding-type 'charset
380 :mnemonic ?D
381 :charset-list '(cp863)
382 :mime-charset 'cp863)
383 (define-coding-system-alias 'ibm863 'cp863)
385 (define-coding-system 'cp865
386 "DOS codepage 865 (Norwegian/Danish)"
387 :coding-type 'charset
388 :mnemonic ?D
389 :charset-list '(cp865)
390 :mime-charset 'cp865)
391 (define-coding-system-alias 'ibm865 'cp865)
393 (define-coding-system 'cp437
394 "DOS codepage 437"
395 :coding-type 'charset
396 :mnemonic ?D
397 :charset-list '(cp437)
398 :mime-charset 'cp437)
399 (define-coding-system-alias 'ibm437 'cp437)
401 (set-language-info-alist
402 "Dutch" '((tutorial . "TUTORIAL.nl")
403 (charset iso-8859-1)
404 (coding-system iso-latin-1 iso-latin-9)
405 (coding-priority iso-latin-1)
406 (nonascii-translation . iso-8859-1)
407 (unibyte-display . iso-latin-1)
408 (input-method . "dutch")
409 (sample-text . "Er is een aantal manieren waarop je dit kan doen")
410 (documentation . "\
411 This language environment is almost the same as Latin-1,
412 but it selects the Dutch tutorial and input method."))
413 '("European"))
415 (set-language-info-alist
416 "German" '((tutorial . "TUTORIAL.de")
417 (charset iso-8859-1)
418 (coding-system iso-latin-1 iso-latin-9)
419 (coding-priority iso-latin-1)
420 (nonascii-translation . iso-8859-1)
421 (input-method . "german-postfix")
422 (unibyte-display . iso-latin-1)
423 (sample-text . "\
424 German (Deutsch Nord) Guten Tag
425 German (Deutsch S\e$(D+d\e(Bd) Gr\e$(D+d)N\e(B Gott")
426 (documentation . "\
427 This language environment is almost the same as Latin-1,
428 but sets the default input method to \"german-postfix\".
429 Additionally, it selects the German tutorial."))
430 '("European"))
432 (set-language-info-alist
433 "French" '((tutorial . "TUTORIAL.fr")
434 (charset iso-8859-1)
435 (coding-system iso-latin-1 iso-latin-9)
436 (coding-priority iso-latin-1)
437 (nonascii-translation . iso-8859-1)
438 (unibyte-display . iso-latin-1)
439 (input-method . "latin-1-prefix")
440 (sample-text . "French (Fran\e$(D+.\e(Bais) Bonjour, Salut")
441 (documentation . "\
442 This language environment is almost the same as Latin-1,
443 but it selects the French tutorial and input method."))
444 '("European"))
446 (set-language-info-alist
447 "Italian" '((tutorial . "TUTORIAL.it")
448 (charset iso-8859-1)
449 (coding-system iso-latin-1 iso-latin-9)
450 (coding-priority iso-latin-1)
451 (nonascii-translation . iso-8859-1)
452 (unibyte-display . iso-latin-1)
453 (input-method . "italian-postfix")
454 (sample-text . "Salve, ciao!")
455 (documentation . "\
456 This language environment is almost the same as Latin-1,
457 but sets the default input method to \"italian-postfix\".
458 Additionally, it selects the Italian tutorial."))
459 '("European"))
461 (set-language-info-alist
462 "Slovenian" '((charset iso-8859-2)
463 (coding-system . (iso-8859-2 windows-1250))
464 (coding-priority . (iso-8859-2))
465 (nonascii-translation . iso-8859-2)
466 (input-method . "slovenian")
467 (unibyte-display . iso-8859-2)
468 (tutorial . "TUTORIAL.sl")
469 (sample-text . "\e$(D*v\e(Belimo vam uspe\e$(D+^\e(Ben dan!")
470 (documentation . "\
471 This language environment is almost the same as Latin-2,
472 but it selects the Slovenian tutorial and input method."))
473 '("European"))
475 (set-language-info-alist
476 "Spanish" '((tutorial . "TUTORIAL.es")
477 (charset iso-8859-1)
478 (coding-system iso-latin-1 iso-latin-9)
479 (coding-priority iso-latin-1)
480 (input-method . "spanish-postfix")
481 (nonascii-translation . iso-8859-1)
482 (unibyte-display . iso-latin-1)
483 (sample-text . "Spanish (Espa\e$(D+P\e(Bol) \e$(D"B\e(BHola!")
484 (documentation . "\
485 This language environment is almost the same as Latin-1,
486 but it sets the default input method to \"spanish-postfix\",
487 and it selects the Spanish tutorial."))
488 '("European"))
490 ;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
491 ;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
492 ;; was used for Turkish. Those who use Latin-3 for Turkish should use
493 ;; "Latin-3" language environment.
495 (set-language-info-alist
496 "Turkish" '((charset iso-8859-9)
497 (coding-system iso-latin-5 windows-1254 iso-latin-3)
498 (coding-priority iso-latin-5)
499 (nonascii-translation . iso-8859-9)
500 (unibyte-display . iso-latin-5)
501 (input-method . "turkish-postfix")
502 (sample-text . "Turkish (T\e$(D+d\e(Brk\e$(D+.\e(Be) Merhaba")
503 (setup-function . turkish-case-conversion-enable)
504 (setup-function . turkish-case-conversion-disable)
505 (documentation . "Support for Turkish.
506 Differs from the Latin-5 environment in using the `turkish-postfix' input
507 method and applying Turkish case rules for the characters i, I, \e$(D)E\e(B, \e$(D*D\e(B.")))
509 (defun turkish-case-conversion-enable ()
510 "Set up Turkish case conversion of `i' and `I' into `\e$(D*D\e(B' and `\e$(D)E\e(B'."
511 (let ((table (standard-case-table)))
512 (set-case-syntax-pair ?\e$(D*D\e(B ?i table)
513 (set-case-syntax-pair ?I ?\e$(D)E\e(B table)))
515 (defun turkish-case-conversion-disable ()
516 "Set up normal (non-Turkish) case conversion of `i' into `I'."
517 (let ((table (standard-case-table)))
518 (set-case-syntax-pair ?I ?i table)
519 (set-case-syntax ?\e$(D*D\e(B "w" table)
520 (set-case-syntax ?\e$(D)E\e(B "w" table)))
522 ;; Polish ISO 8859-2 environment.
523 ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
524 ;; Keywords: multilingual, Polish
526 (set-language-info-alist
527 "Polish" '((charset iso-8859-2)
528 (coding-system iso-8859-2 windows-1250)
529 (coding-priority iso-8859-2)
530 (input-method . "polish-slash")
531 (nonascii-translation . iso-8859-2)
532 (unibyte-display . iso-8859-2)
533 (tutorial . "TUTORIAL.pl")
534 (sample-text . "P\e$(D+Q\e(Bjd\e$(D+u\e(B, ki\e$(D+M\e(B-\e$(D+w\e(Be t\e$(D+8\e(B chmurno\e$(D+\++\e(B w g\e$(D)H+(\e(Bb flaszy")
535 (documentation . t))
536 '("European"))
538 (set-language-info-alist
539 "Welsh" `((coding-system utf-8 latin-8) ; the input method is Unicode-based
540 (coding-priority utf-8 latin-8)
541 (nonascii-translation . iso-8859-14)
542 (input-method . "welsh")
543 (documentation . "Support for Welsh, using Unicode."))
544 '("European"))
546 (set-language-info-alist
547 "Latin-6" `((coding-system latin-6)
548 (coding-priority latin-6)
549 (nonascii-translation . ,(get 'decode-iso-latin-6 'translation-table))
550 (input-method . "latin-prefix")
551 (features code-pages)
552 (documentation . "Support for Latin-6."))
553 '("European"))
555 (set-language-info-alist
556 "Latin-7" `((coding-system latin-7)
557 (coding-priority latin-7)
558 (nonascii-translation . iso-8859-13)
559 (input-method . "latin-prefix")
560 (documentation . "Support for Latin-7, e.g. Latvian, Lithuanian."))
561 '("European"))
563 (set-language-info-alist
564 "Lithuanian" `((coding-system latin-7 windows-1257)
565 (coding-priority latin-7)
566 (nonascii-translation . iso-8859-13)
567 (input-method . "lithuanian-keyboard")
568 (documentation . "Support for Lithuanian."))
569 '("European"))
571 (set-language-info-alist
572 "Latvian" `((coding-system latin-7 windows-1257)
573 (coding-priority latin-7)
574 (nonascii-translation . iso-8859-13)
575 (input-method . "latvian-keyboard")
576 (documentation . "Support for Latvian."))
577 '("European"))
579 (set-language-info-alist
580 "Swedish" '((tutorial . "TUTORIAL.sv")
581 (charset iso-8859-1)
582 (coding-system iso-latin-1)
583 (coding-priority iso-latin-1)
584 (nonascii-translation . iso-8859-1)
585 (unibyte-display . iso-latin-1)
586 (sample-text . "Goddag Hej")
587 (documentation . "Support for Swedish"))
588 '("European"))
590 (set-language-info-alist
591 "Croatian" '((charset iso-8859-2)
592 (coding-system iso-8859-2)
593 (coding-priority iso-8859-2)
594 (input-method . "croatian")
595 (nonascii-translation . iso-8859-2)
596 (unibyte-display . iso-8859-2)
597 (documentation . "Support for Croatian with Latin-2 encoding."))
598 '("European"))
600 (set-language-info-alist
601 "Brazilian Portuguese" '((tutorial . "TUTORIAL.pt_BR")
602 (charset iso-8859-1)
603 (coding-system iso-latin-1 iso-latin-9)
604 (coding-priority iso-latin-1)
605 (nonascii-translation . iso-8859-1)
606 (unibyte-display . iso-8859-1)
607 (input-method . "latin-1-prefix")
608 (sample-text . "Oi")
609 (documentation . "Support for Brazilian Portuguese."))
610 '("European"))
613 (define-coding-system 'mac-roman
614 "Mac Roman Encoding (MIME:MACINTOSH)."
615 :coding-type 'charset
616 :mnemonic ?M
617 :charset-list '(mac-roman)
618 :mime-charset 'macintosh)
620 (define-coding-system 'next
621 "NeXTstep encoding"
622 :coding-type 'charset
623 :mnemonic ?*
624 :charset-list '(next)
625 :mime-charset 'next)
627 (define-coding-system 'hp-roman8
628 "Hewlet-Packard roman-8 encoding (MIME:ROMAN-8)"
629 :coding-type 'charset
630 :mnemonic ?*
631 :charset-list '(hp-roman8)
632 :mime-charset 'hp-roman8)
633 (define-coding-system-alias 'roman8 'hp-roman8)
635 (define-coding-system 'adobe-standard-encoding
636 "Adobe `standard' encoding for PostScript"
637 :coding-type 'charset
638 :mnemonic ?*
639 :charset-list '(adobe-standard-encoding)
640 :mime-charset 'adobe-standard-encoding)
643 ;; For automatic composing of diacritics and combining marks.
644 (dolist (range '( ;; combining diacritical marks
645 (#x0300 #x0314 (tc . bc))
646 (#x0315 (tr . bl))
647 (#x0316 #x0319 (bc . tc))
648 (#x031A (tr . cl))
649 (#x031B #x0320 (bc . tc))
650 (#x0321 (Br . tr))
651 (#x0322 (Br . tl))
652 (#x0323 #x0333 (bc . tc))
653 (#x0334 #x0338 (Bc . Bc))
654 (#x0339 #x033C (bc . tc))
655 (#x033D #x033F (tc . bc))
656 (#x0340 (tl . bc))
657 (#x0341 (tr . bc))
658 (#x0342 #x0344 (tc . bc))
659 (#x0345 (bc . tc))
660 (#x0346 (tc . bc))
661 (#x0347 #x0349 (bc . tc))
662 (#x034A #x034C (tc . bc))
663 (#x034D #x034E (bc . tc))
664 ;; combining diacritical marks for symbols
665 (#x20D0 #x20D1 (tc . bc))
666 (#x20D2 #x20D3 (Bc . Bc))
667 (#x20D4 #x20D7 (tc . bc))
668 (#x20D8 #x20DA (Bc . Bc))
669 (#x20DB #x20DC (tc . bc))
670 (#x20DD #x20E0 (Bc . Bc))
671 (#x20E1 (tc . bc))
672 (#x20E2 #x20E3 (Bc . Bc))))
673 (let* ((from (car range))
674 (to (if (= (length range) 3)
675 (nth 1 range)
676 from))
677 (composition (car (last range))))
678 (while (<= from to)
679 (put-char-code-property from 'diacritic-composition composition)
680 (aset composition-function-table from 'diacritic-composition-function)
681 (setq from (1+ from)))))
683 (defconst diacritic-composition-pattern "\\C^\\c^+")
685 (defun diacritic-compose-region (beg end)
686 "Compose diacritic characters in the region.
687 When called from a program, expects two arguments,
688 positions (integers or markers) specifying the region."
689 (interactive "r")
690 (save-restriction
691 (narrow-to-region beg end)
692 (goto-char (point-min))
693 (while (re-search-forward diacritic-composition-pattern nil t)
694 (if (= (char-syntax (char-after (match-beginning 0))) ?w)
695 (compose-region (match-beginning 0) (match-end 0))))))
697 (defun diacritic-compose-string (string)
698 "Compose diacritic characters in STRING and return the resulting string."
699 (let ((idx 0))
700 (while (setq idx (string-match diacritic-composition-pattern string idx))
701 (if (= (char-syntax (aref string idx)) ?w)
702 (compose-string string idx (match-end 0)))
703 (setq idx (match-end 0))))
704 string)
706 (defun diacritic-compose-buffer ()
707 "Compose diacritic characters in the current buffer."
708 (interactive)
709 (diacritic-compose-region (point-min) (point-max)))
711 (defun diacritic-composition-function (pos to font-object string)
712 "Compose diacritic text around POS.
713 Optional 2nd argument STRING, if non-nil, is a string containing text
714 to compose.
716 The return value is the end position of composed characters,
717 or nil if no characters are composed."
718 (setq pos (1- pos))
719 (if string
720 (if (>= pos 0)
721 (let ((ch (aref string pos))
722 start end components ch composition)
723 (when (= (char-syntax ch) ?w)
724 (setq start pos
725 end (length string)
726 components (list ch)
727 pos (1+ pos))
728 (while (and
729 (< pos end)
730 (setq ch (aref string pos)
731 composition
732 (get-char-code-property ch
733 'diacritic-composition)))
734 (setq components (cons ch (cons composition components))
735 pos (1+ pos)))
736 (compose-string string start pos (nreverse components))
737 pos)))
738 (if (>= pos (point-min))
739 (let ((ch (char-after pos))
740 start end components composition)
741 (when (= (char-syntax ch) ?w)
742 (setq start pos
743 end (point-max)
744 components (list ch)
745 pos (1+ pos))
746 (while (and
747 (< pos end)
748 (setq ch (char-after pos)
749 composition
750 (get-char-code-property ch 'diacritic-composition)))
751 (setq components (cons ch (cons composition components))
752 pos (1+ pos)))
753 (compose-region start pos (nreverse components))
754 pos)))))
756 (provide 'european)
758 ;;; arch-tag: 9e018b12-fb02-4120-907b-9adeaf84b5c2
759 ;;; european.el ends here