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