Update AIST copyright years.
[bpt/emacs.git] / lisp / language / european.el
CommitLineData
e8af40ee 1;;; european.el --- support for European languages -*- coding: iso-2022-7bit; -*-
4ed46869 2
d4877ac1 3;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006
eaa61218 4;; Free Software Foundation, Inc.
7976eda0 5;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
d4877ac1 6;; 2005, 2006
eaa61218
KH
7;; National Institute of Advanced Industrial Science and Technology (AIST)
8;; Registration Number H14PRO021
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 25;; along with GNU Emacs; see the file COPYING. If not, write to the
3a35cf56
LK
26;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27;; Boston, MA 02110-1301, USA.
4ed46869
KH
28
29;;; Commentary:
30
b978d1a3
DL
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
bed54678 39 "Latin-1" '((charset ascii latin-iso8859-1)
3617715a 40 (coding-system iso-latin-1)
8584826b 41 (coding-priority iso-latin-1 windows-1252)
bed54678 42 (nonascii-translation . latin-iso8859-1)
16b2eb50 43 (unibyte-syntax . "latin-1")
bed54678 44 (unibyte-display . iso-latin-1)
3e56710f 45 (input-method . "latin-1-prefix")
5c4794f3
RS
46 (sample-text
47 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
3617715a 48 (documentation . "\
cce3ba48
DL
49This language environment is a generic one for the Latin-1 (ISO-8859-1)
50character set which supports the following European languages:
51 Albanian, Basque, Breton, Catalan, Danish, Dutch, English, Faeroese,
52 Finnish, French (with restrictions -- see Latin-9), Frisian, Galician,
53 German, Greenlandic, Icelandic, Irish Gaelic (new orthography),
54 Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic,
55 Scottish Gaelic, Spanish, and Swedish.
cd53f29e
KH
56We also have specific language environments for the following languages:
57 For Dutch, \"Dutch\".
58 For German, \"German\".
cc01e274 59 For French, \"French\".
6f3ab39c
FP
60 For Italian, \"Italian\".
61 For Slovenian, \"Slovenian\".
62 For Spanish, \"Spanish\".
cce3ba48
DL
63
64Latin-1 also covers several written languages outside Europe, including
65Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
3617715a
KH
66 '("European"))
67
b978d1a3
DL
68(eval-and-compile
69 (setq
70 non-iso-charset-alist
71 (cp-make-coding-system
72 windows-1252
7453c3ac
KH
73 [?\\e$,1tL\e(B nil ?\\e$,1rz\e(B ?\\e$,1!R\e(B ?\\e$,1r~\e(B ?\\e$,1s&\e(B ?\\e$,1s \e(B ?\\e$,1s!\e(B ?\\e$,1$f\e(B ?\\e$,1s0\e(B ?\\e$,1! \e(B ?\\e$,1s9\e(B ?\\e$,1 r\e(B nil ?\\e$,1!=\e(B nil nil
74 ?\\e$,1rx\e(B ?\\e$,1ry\e(B ?\\e$,1r|\e(B ?\\e$,1r}\e(B ?\\e$,1s"\e(B ?\\e$,1rs\e(B ?\\e$,1rt\e(B ?\\e$,1$|\e(B ?\\e$,1ub\e(B ?\\e$,1!!\e(B ?\\e$,1s:\e(B ?\\e$,1 s\e(B nil ?\\e$,1!>\e(B ?\\e$,1!8\e(B ?\\e,A \e(B ?\\e,A!\e(B
b978d1a3
DL
75 ?\\e,A"\e(B ?\\e,A#\e(B ?\\e,A$\e(B ?\\e,A%\e(B ?\\e,A&\e(B ?\\e,A'\e(B ?\\e,A(\e(B ?\\e,A)\e(B ?\\e,A*\e(B ?\\e,A+\e(B ?\\e,A,\e(B ?\\e,A-\e(B ?\\e,A.\e(B ?\\e,A/\e(B ?\\e,A0\e(B ?\\e,A1\e(B ?\\e,A2\e(B
76 ?\\e,A3\e(B ?\\e,A4\e(B ?\\e,A5\e(B ?\\e,A6\e(B ?\\e,A7\e(B ?\\e,A8\e(B ?\\e,A9\e(B ?\\e,A:\e(B ?\\e,A;\e(B ?\\e,A<\e(B ?\\e,A=\e(B ?\\e,A>\e(B ?\\e,A?\e(B ?\\e,A@\e(B ?\\e,AA\e(B ?\\e,AB\e(B ?\\e,AC\e(B
77 ?\\e,AD\e(B ?\\e,AE\e(B ?\\e,AF\e(B ?\\e,AG\e(B ?\\e,AH\e(B ?\\e,AI\e(B ?\\e,AJ\e(B ?\\e,AK\e(B ?\\e,AL\e(B ?\\e,AM\e(B ?\\e,AN\e(B ?\\e,AO\e(B ?\\e,AP\e(B ?\\e,AQ\e(B ?\\e,AR\e(B ?\\e,AS\e(B ?\\e,AT\e(B
78 ?\\e,AU\e(B ?\\e,AV\e(B ?\\e,AW\e(B ?\\e,AX\e(B ?\\e,AY\e(B ?\\e,AZ\e(B ?\\e,A[\e(B ?\\e,A\\e(B ?\\e,A]\e(B ?\\e,A^\e(B ?\\e,A_\e(B ?\\e,A`\e(B ?\\e,Aa\e(B ?\\e,Ab\e(B ?\\e,Ac\e(B ?\\e,Ad\e(B ?\\e,Ae\e(B
79 ?\\e,Af\e(B ?\\e,Ag\e(B ?\\e,Ah\e(B ?\\e,Ai\e(B ?\\e,Aj\e(B ?\\e,Ak\e(B ?\\e,Al\e(B ?\\e,Am\e(B ?\\e,An\e(B ?\\e,Ao\e(B ?\\e,Ap\e(B ?\\e,Aq\e(B ?\\e,Ar\e(B ?\\e,As\e(B ?\\e,At\e(B ?\\e,Au\e(B ?\\e,Av\e(B
80 ?\\e,Aw\e(B ?\\e,Ax\e(B ?\\e,Ay\e(B ?\\e,Az\e(B ?\\e,A{\e(B ?\\e,A|\e(B ?\\e,A}\e(B ?\\e,A~\e(B ?\\e,A\7f\e(B])))
4a3d351d
KH
81
82(define-coding-system-alias 'cp1252 'windows-1252)
83
335a7ad7 84\f
5c4794f3 85;; Latin-2 (ISO-8859-2)
335a7ad7 86
4ed46869 87(make-coding-system
4b9121fc 88 'iso-latin-2 2 ?2
5ef35063 89 "ISO 2022 based 8-bit encoding for Latin-2 (MIME:ISO-8859-2)."
3617715a 90 '(ascii latin-iso8859-2 nil nil
c25713f1 91 nil nil nil nil nil nil nil nil nil nil nil t)
3617715a
KH
92 '((safe-charsets ascii latin-iso8859-2)
93 (mime-charset . iso-8859-2)))
4ed46869 94
71eabd24 95(define-coding-system-alias 'iso-8859-2 'iso-latin-2)
300c450d 96(define-coding-system-alias 'latin-2 'iso-latin-2)
4b9121fc 97
335a7ad7 98(set-language-info-alist
bed54678 99 "Latin-2" '((charset ascii latin-iso8859-2)
3617715a
KH
100 (coding-system iso-latin-2)
101 (coding-priority iso-latin-2)
bed54678 102 (nonascii-translation . latin-iso8859-2)
16b2eb50 103 (unibyte-syntax . "latin-2")
bed54678 104 (unibyte-display . iso-latin-2)
3e56710f 105 (input-method . "latin-2-prefix")
3617715a 106 (documentation . "\
cce3ba48 107This language environment is a generic one for the Latin-2 (ISO-8859-2)
e325120d 108character set which supports the following languages:
60763153 109 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
59c1ccf2 110 Serbo-Croatian or Croatian, Slovak, Slovene, Sorbian (upper and lower),
e325120d
KH
111 and Swedish.
112We also have specific language environments for the following languages:
113 For Czech, \"Czech\".
eae03b2d 114 For Croatian, \"Croatian\".
e325120d
KH
115 For Romanian, \"Romanian\".
116 For Slovak, \"Slovak\"."))
3617715a
KH
117 '("European"))
118
335a7ad7 119\f
5c4794f3 120;; Latin-3 (ISO-8859-3)
335a7ad7 121
4ed46869 122(make-coding-system
4b9121fc 123 'iso-latin-3 2 ?3
5ef35063 124 "ISO 2022 based 8-bit encoding for Latin-3 (MIME:ISO-8859-3)."
3617715a 125 '(ascii latin-iso8859-3 nil nil
c25713f1 126 nil nil nil nil nil nil nil nil nil nil nil t)
3617715a
KH
127 '((safe-charsets ascii latin-iso8859-3)
128 (mime-charset . iso-8859-3)))
4ed46869 129
71eabd24 130(define-coding-system-alias 'iso-8859-3 'iso-latin-3)
300c450d 131(define-coding-system-alias 'latin-3 'iso-latin-3)
4b9121fc 132
335a7ad7 133(set-language-info-alist
bed54678 134 "Latin-3" '((charset ascii latin-iso8859-3)
3617715a
KH
135 (coding-system iso-latin-3)
136 (coding-priority iso-latin-3)
bed54678 137 (nonascii-translation . latin-iso8859-3)
16b2eb50 138 (unibyte-syntax . "latin-3")
bed54678 139 (unibyte-display . iso-latin-3)
3e56710f 140 (input-method . "latin-3-prefix")
3617715a 141 (documentation . "\
60763153
RS
142These languages are supported with the Latin-3 (ISO-8859-3) character set:
143 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
3617715a
KH
144 German, Italian, Maltese, Spanish, and Turkish."))
145 '("European"))
146
335a7ad7 147\f
5c4794f3 148;; Latin-4 (ISO-8859-4)
335a7ad7 149
4ed46869 150(make-coding-system
4b9121fc 151 'iso-latin-4 2 ?4
5ef35063 152 "ISO 2022 based 8-bit encoding for Latin-4 (MIME:ISO-8859-4)."
3617715a 153 '(ascii latin-iso8859-4 nil nil
c25713f1 154 nil nil nil nil nil nil nil nil nil nil nil t)
3617715a 155 '((safe-charsets ascii latin-iso8859-4)
8585266f 156 (mime-charset . iso-8859-4)))
4ed46869 157
71eabd24 158(define-coding-system-alias 'iso-8859-4 'iso-latin-4)
300c450d 159(define-coding-system-alias 'latin-4 'iso-latin-4)
4b9121fc 160
335a7ad7 161(set-language-info-alist
bed54678 162 "Latin-4" '((charset ascii latin-iso8859-4)
3617715a
KH
163 (coding-system iso-8859-4)
164 (coding-priority iso-8859-4)
bed54678 165 (nonascii-translation . latin-iso8859-4)
16b2eb50 166 (unibyte-syntax . "latin-4")
bed54678 167 (unibyte-display . iso-8859-4)
11f340ed 168 (input-method . "latin-4-postfix")
3617715a 169 (documentation . "\
60763153
RS
170These languages are supported with the Latin-4 (ISO-8859-4) character set:
171 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
3617715a
KH
172 Latvian, Lithuanian, and Norwegian."))
173 '("European"))
174
335a7ad7 175\f
5c4794f3 176;; Latin-5 (ISO-8859-9)
335a7ad7 177
4ed46869 178(make-coding-system
4b9121fc 179 'iso-latin-5 2 ?9
5ef35063 180 "ISO 2022 based 8-bit encoding for Latin-5 (MIME:ISO-8859-9)."
3617715a 181 '(ascii latin-iso8859-9 nil nil
c25713f1 182 nil nil nil nil nil nil nil nil nil nil nil t)
3617715a
KH
183 '((safe-charsets ascii latin-iso8859-9)
184 (mime-charset . iso-8859-9)))
4ed46869 185
71eabd24 186(define-coding-system-alias 'iso-8859-9 'iso-latin-5)
300c450d 187(define-coding-system-alias 'latin-5 'iso-latin-5)
4b9121fc 188
3617715a 189(set-language-info-alist
bed54678 190 "Latin-5" '((charset ascii latin-iso8859-9)
3617715a
KH
191 (coding-system iso-latin-5)
192 (coding-priority iso-latin-5)
bed54678 193 (nonascii-translation . latin-iso8859-9)
16b2eb50 194 (unibyte-syntax . "latin-5")
bed54678 195 (unibyte-display . iso-latin-5)
11f340ed 196 (input-method . "latin-5-postfix")
b24cd22e 197 (documentation . "Support for Turkish language."))
cce3ba48
DL
198 '("European"))
199
200\f
201;; Latin-8 (ISO-8859-14)
202
203(make-coding-system
204 'iso-latin-8 2 ?W ; `W' for `Welsh', since `C'
205 ; for `Celtic' is taken.
5ef35063 206 "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)."
cce3ba48 207 '(ascii latin-iso8859-14 nil nil
c25713f1 208 nil nil nil nil nil nil nil nil nil nil nil t t)
cce3ba48
DL
209 '((safe-charsets ascii latin-iso8859-14)
210 (mime-charset . iso-8859-14)))
211
212(define-coding-system-alias 'iso-8859-14 'iso-latin-8)
213(define-coding-system-alias 'latin-8 'iso-latin-8)
214
cce3ba48
DL
215(set-language-info-alist
216 "Latin-8" '((charset ascii latin-iso8859-14)
217 (coding-system iso-latin-8)
218 (coding-priority iso-latin-8)
219 (nonascii-translation . latin-iso8859-14)
220 (unibyte-syntax . "latin-8")
221 (unibyte-display . iso-latin-8)
27ff18c9
DL
222 (input-method . "latin-8-prefix")
223 ;; Fixme: Welsh/Ga{e}lic greetings
224 (sample-text . "\e,_"\e(B \e,_p\e(B \e,_^\e(B")
cce3ba48
DL
225 (documentation . "\
226This language environment is a generic one for the Latin-8 (ISO-8859-14)
27ff18c9 227character set which supports the Celtic languages, including those not
5ef35063
WL
228covered by other ISO-8859 character sets:
229 Welsh, Manx Gaelic and Irish Gaelic (old orthography)."))
3617715a 230 '("European"))
cce3ba48
DL
231\f
232;; Latin-9 (ISO-8859-15)
233
234(make-coding-system
235 'iso-latin-9 2 ?0 ; `0' for `Latin-0'
5ef35063 236 "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)."
cce3ba48 237 '(ascii latin-iso8859-15 nil nil
c25713f1 238 nil nil nil nil nil nil nil nil nil nil nil t t)
cce3ba48
DL
239 '((safe-charsets ascii latin-iso8859-15)
240 (mime-charset . iso-8859-15)))
241
242(define-coding-system-alias 'iso-8859-15 'iso-latin-9)
243(define-coding-system-alias 'latin-9 'iso-latin-9)
244(define-coding-system-alias 'latin-0 'iso-latin-9)
3617715a 245
cce3ba48
DL
246(set-language-info-alist
247 "Latin-9" '((charset ascii latin-iso8859-15)
248 (coding-system iso-latin-9)
249 (coding-priority iso-latin-9)
250 (nonascii-translation . latin-iso8859-15)
251 (unibyte-syntax . "latin-9")
252 (unibyte-display . iso-latin-9)
27ff18c9 253 (input-method . "latin-9-prefix")
cce3ba48 254 (sample-text
27ff18c9 255 . "AVE. \e,b&(48<=>\e(B \e,b$\e(B")
cce3ba48
DL
256 (documentation . "\
257This language environment is a generic one for the Latin-9 (ISO-8859-15)
258character set which supports the same languages as Latin-1 with the
259addition of the Euro sign and some additional French and Finnish letters.
260Latin-9 is sometimes nicknamed `Latin-0'."))
261 '("European"))
3617715a 262\f
6f3ab39c
FP
263(set-language-info-alist
264 "Dutch" '((tutorial . "TUTORIAL.nl")
265 (charset ascii latin-iso8859-1)
266 (coding-system iso-latin-1 iso-latin-9)
267 (coding-priority iso-latin-1)
268 (nonascii-translation . latin-iso8859-1)
269 (unibyte-syntax . "latin-1")
270 (unibyte-display . iso-latin-1)
271 (input-method . "dutch")
272 (sample-text . "Er is een aantal manieren waarop je dit kan doen")
273 (documentation . "\
274This language environment is almost the same as Latin-1,
275but it selects the Dutch tutorial and input method."))
276 '("European"))
277
4ed46869 278(set-language-info-alist
bed54678 279 "German" '((tutorial . "TUTORIAL.de")
3617715a 280 (charset ascii latin-iso8859-1)
edc64f42 281 (coding-system iso-latin-1 iso-latin-9)
8584826b 282 (coding-priority iso-latin-1 windows-1252)
3e56710f 283 (input-method . "german-postfix")
eae03b2d 284 (nonascii-translation . latin-iso8859-1)
16b2eb50 285 (unibyte-syntax . "latin-1")
bed54678 286 (unibyte-display . iso-latin-1)
3617715a
KH
287 (sample-text . "\
288German (Deutsch Nord) Guten Tag
289German (Deutsch S\e,A|\e(Bd) Gr\e,A|_\e(B Gott")
290 (documentation . "\
291This language environment is almost the same as Latin-1,
70a4f3ea
WL
292but sets the default input method to \"german-postfix\".
293Additionally, it selects the German tutorial."))
3617715a 294 '("European"))
8dfef503 295
fdd2d14d
EZ
296(set-language-info-alist
297 "French" '((tutorial . "TUTORIAL.fr")
298 (charset ascii latin-iso8859-1)
edc64f42 299 (coding-system iso-latin-1 iso-latin-9)
fdd2d14d
EZ
300 (coding-priority iso-latin-1)
301 (nonascii-translation . latin-iso8859-1)
302 (unibyte-syntax . "latin-1")
303 (unibyte-display . iso-latin-1)
304 (input-method . "latin-1-prefix")
305 (sample-text . "French (Fran\e,Ag\e(Bais) Bonjour, Salut")
306 (documentation . "\
307This language environment is almost the same as Latin-1,
b1c0272c 308but it selects the French tutorial and input method."))
fdd2d14d
EZ
309 '("European"))
310
0dcfc7bc
FP
311(set-language-info-alist
312 "Italian" '((tutorial . "TUTORIAL.it")
313 (charset ascii latin-iso8859-1)
314 (coding-system iso-latin-1 iso-latin-9)
315 (coding-priority iso-latin-1)
316 (nonascii-translation . latin-iso8859-1)
317 (unibyte-syntax . "latin-1")
318 (unibyte-display . iso-latin-1)
319 (input-method . "italian-postfix")
320 (sample-text . "Salve, ciao!")
321 (documentation . "\
322This language environment is almost the same as Latin-1,
323but sets the default input method to \"italian-postfix\".
324Additionally, it selects the Italian tutorial."))
325 '("European"))
326
e0980142
RS
327(set-language-info-alist
328 "Slovenian" '((charset . (ascii latin-iso8859-2))
329 (coding-system . (iso-8859-2))
330 (coding-priority . (iso-8859-2))
331 (nonascii-translation . latin-iso8859-2)
57ef7816 332 (input-method . "slovenian")
e0980142
RS
333 (unibyte-syntax . "latin-2")
334 (unibyte-display . iso-8859-2)
335 (tutorial . "TUTORIAL.sl")
336 (sample-text . "\e,B.\e(Belimo vam uspe\e,B9\e(Ben dan!")
b1c0272c
FP
337 (documentation . "\
338This language environment is almost the same as Latin-2,
339but it selects the Slovenian tutorial and input method."))
e0980142
RS
340 '("European"))
341
891258f2
GM
342(set-language-info-alist
343 "Spanish" '((tutorial . "TUTORIAL.es")
344 (charset ascii latin-iso8859-1)
edc64f42 345 (coding-system iso-latin-1 iso-latin-9)
891258f2
GM
346 (coding-priority iso-latin-1)
347 (input-method . "spanish-postfix")
eae03b2d 348 (nonascii-translation . latin-iso8859-1)
891258f2
GM
349 (unibyte-syntax . "latin-1")
350 (unibyte-display . iso-latin-1)
351 (sample-text . "Spanish (Espa\e,Aq\e(Bol) \e,A!\e(BHola!")
352 (documentation . "\
353This language environment is almost the same as Latin-1,
70a4f3ea 354but it sets the default input method to \"spanish-postfix\",
a959e723 355and it selects the Spanish tutorial."))
891258f2
GM
356 '("European"))
357
d22c4fb9
KH
358;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
359;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
360;; was used for Turkish. Those who use Latin-3 for Turkish should use
361;; "Latin-3" language environment.
362
363(set-language-info-alist
364 "Turkish" '((charset ascii latin-iso8859-9)
edc64f42 365 (coding-system iso-latin-5 iso-latin-3)
d22c4fb9
KH
366 (coding-priority iso-latin-5)
367 (nonascii-translation . latin-iso8859-9)
368 (unibyte-syntax . "latin-5")
369 (unibyte-display . iso-latin-5)
370 (input-method . "turkish-postfix")
371 (sample-text . "Turkish (T\e,M|\e(Brk\e,Mg\e(Be) Merhaba")
f2b0f1f3
RS
372 (documentation . t)
373 (setup-function . turkish-case-conversion-enable)
374 (exit-function . turkish-case-conversion-disable)))
375
376(defun turkish-case-conversion-enable ()
377 "Set up Turkish case conversion of `i' and `I' into `\e$,1 P\e(B' and `\e$,1 Q\e(B'."
378 (let ((table (standard-case-table)))
379 (set-case-syntax-pair ?\e$,1 P\e(B ?i table)
380 (set-case-syntax-pair ?I ?\e$,1 Q\e(B table)))
381
382(defun turkish-case-conversion-disable ()
383 "Set up normal (non-Turkish) case conversion of `i' into `I'."
384 (let ((table (standard-case-table)))
385 (set-case-syntax-pair ?I ?i table)
386 (set-case-syntax ?\e$,1 P\e(B "w" table)
387 (set-case-syntax ?\e$,1 Q\e(B "w" table)))
d22c4fb9 388
b9427ca6
KH
389;; Polish ISO 8859-2 environment.
390;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
391;; Keywords: multilingual, Polish
392
b9427ca6
KH
393(set-language-info-alist
394 "Polish" '((charset . (ascii latin-iso8859-2))
395 (coding-system . (iso-8859-2))
396 (coding-priority . (iso-8859-2))
397 (input-method . "polish-slash")
398 (nonascii-translation . latin-iso8859-2)
399 (unibyte-syntax . "latin-2")
400 (unibyte-display . iso-8859-2)
401 (tutorial . "TUTORIAL.pl")
2a52f40e 402 (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")
b9427ca6
KH
403 (documentation . t))
404 '("European"))
405
3286933f
DL
406(set-language-info-alist
407 "Welsh" `((coding-system utf-8 latin-8) ; the input method is Unicode-based
408 (coding-priority utf-8 latin-8)
eae03b2d 409 (nonascii-translation . latin-iso8859-14)
3286933f
DL
410 (input-method . "welsh")
411 (documentation . "Support for Welsh, using Unicode."))
412 '("European"))
413
eae03b2d
DL
414(set-language-info-alist
415 "Latin-6" `((coding-system latin-6)
416 (coding-priority latin-6)
417 (nonascii-translation . ,(get 'decode-iso-latin-6 'translation-table))
bccb30c4 418 (input-method . "latin-prefix")
eae03b2d
DL
419 (features code-pages)
420 (documentation . "Support for Latin-6."))
421 '("European"))
422
3286933f
DL
423(set-language-info-alist
424 "Latin-7" `((coding-system latin-7)
425 (coding-priority latin-7)
eae03b2d
DL
426 (nonascii-translation . ,(get 'decode-iso-latin-7
427 'translation-table))
bccb30c4 428 (input-method . "latin-prefix")
3286933f
DL
429 (features code-pages)
430 (documentation . "Support for Latin-7, e.g. Latvian, Lithuanian."))
431 '("European"))
432
433(set-language-info-alist
434 "Lithuanian" `((coding-system latin-7)
435 (coding-priority latin-7)
436 (input-method . "lithuanian-keyboard")
eae03b2d
DL
437 (nonascii-translation . ,(get 'decode-iso-latin-7
438 'translation-table))
3286933f
DL
439 (features code-pages)
440 (documentation . "Support for Lithuanian."))
441 '("European"))
442
443(set-language-info-alist
444 "Latvian" `((coding-system latin-7)
445 (coding-priority latin-7)
446 (input-method . "latvian-keyboard")
eae03b2d
DL
447 (nonascii-translation . ,(get 'decode-iso-latin-7
448 'translation-table))
3286933f
DL
449 (features code-pages)
450 (documentation . "Support for Latvian."))
451 '("European"))
adc7d9cd
RS
452
453(set-language-info-alist
88ee27e5 454 "Swedish" '((tutorial . "TUTORIAL.sv")
adc7d9cd
RS
455 (charset ascii latin-iso8859-1)
456 (coding-system iso-latin-1)
457 (coding-priority iso-latin-1)
eae03b2d 458 (nonascii-translation . latin-iso8859-1)
adc7d9cd
RS
459 (unibyte-syntax . "latin-1")
460 (unibyte-display . iso-latin-1)
461 (sample-text . "Goddag Hej")
462 (documentation . "Support for Swedish"))
463 '("European"))
eae03b2d
DL
464
465(set-language-info-alist
466 "Croatian" '((charset . (ascii latin-iso8859-2))
467 (coding-system . (iso-8859-2))
468 (coding-priority . (iso-8859-2))
469 (input-method . "croatian")
470 (nonascii-translation . latin-iso8859-2)
471 (unibyte-syntax . "latin-2")
472 (unibyte-display . iso-8859-2)
473 (documentation . "Support for Croatian with Latin-2 encoding."))
474 '("European"))
c7a73294
DK
475
476(set-language-info-alist
477 "Brazilian Portuguese" '((tutorial . "TUTORIAL.pt_BR")
478 (charset ascii latin-iso8859-1)
479 (coding-system iso-latin-1 iso-latin-9)
480 (coding-priority iso-latin-1)
481 (nonascii-translation . latin-iso8859-1)
482 (unibyte-syntax . "latin-1")
483 (unibyte-display . iso-latin-1)
484 (input-method . "latin-1-prefix")
485 (sample-text . "Oi")
486 (documentation . "Support for Brazilian Portuguese."))
487 '("European"))
71070f12
KH
488\f
489;; Definitions for the Mac Roman character sets and coding system.
490;; The Mac Roman encoding uses all 128 code points in the range 128 to
a75f7176 491;; 255 for actual characters. Emacs decodes them to one of the
71070f12
KH
492;; following character sets.
493;; ascii, latin-iso8859-1, mule-unicode-0100-24ff,
494;; mule-unicode-2500-33ff, mule-unicode-e000-ffff
495
496(let
497 ((encoding-vector (make-vector 256 nil))
498 (i 0)
499 (vec ;; mac-roman (128..255) -> UCS mapping
500 [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS
501 #x00C5 ;; 129:LATIN CAPITAL LETTER A WITH RING ABOVE
502 #x00C7 ;; 130:LATIN CAPITAL LETTER C WITH CEDILLA
503 #x00C9 ;; 131:LATIN CAPITAL LETTER E WITH ACUTE
504 #x00D1 ;; 132:LATIN CAPITAL LETTER N WITH TILDE
505 #x00D6 ;; 133:LATIN CAPITAL LETTER O WITH DIAERESIS
506 #x00DC ;; 134:LATIN CAPITAL LETTER U WITH DIAERESIS
507 #x00E1 ;; 135:LATIN SMALL LETTER A WITH ACUTE
508 #x00E0 ;; 136:LATIN SMALL LETTER A WITH GRAVE
509 #x00E2 ;; 137:LATIN SMALL LETTER A WITH CIRCUMFLEX
510 #x00E4 ;; 138:LATIN SMALL LETTER A WITH DIAERESIS
511 #x00E3 ;; 139:LATIN SMALL LETTER A WITH TILDE
512 #x00E5 ;; 140:LATIN SMALL LETTER A WITH RING ABOVE
513 #x00E7 ;; 141:LATIN SMALL LETTER C WITH CEDILLA
514 #x00E9 ;; 142:LATIN SMALL LETTER E WITH ACUTE
515 #x00E8 ;; 143:LATIN SMALL LETTER E WITH GRAVE
516 #x00EA ;; 144:LATIN SMALL LETTER E WITH CIRCUMFLEX
517 #x00EB ;; 145:LATIN SMALL LETTER E WITH DIAERESIS
518 #x00ED ;; 146:LATIN SMALL LETTER I WITH ACUTE
519 #x00EC ;; 147:LATIN SMALL LETTER I WITH GRAVE
520 #x00EE ;; 148:LATIN SMALL LETTER I WITH CIRCUMFLEX
521 #x00EF ;; 149:LATIN SMALL LETTER I WITH DIAERESIS
522 #x00F1 ;; 150:LATIN SMALL LETTER N WITH TILDE
523 #x00F3 ;; 151:LATIN SMALL LETTER O WITH ACUTE
524 #x00F2 ;; 152:LATIN SMALL LETTER O WITH GRAVE
525 #x00F4 ;; 153:LATIN SMALL LETTER O WITH CIRCUMFLEX
526 #x00F6 ;; 154:LATIN SMALL LETTER O WITH DIAERESIS
527 #x00F5 ;; 155:LATIN SMALL LETTER O WITH TILDE
528 #x00FA ;; 156:LATIN SMALL LETTER U WITH ACUTE
529 #x00F9 ;; 157:LATIN SMALL LETTER U WITH GRAVE
530 #x00FB ;; 158:LATIN SMALL LETTER U WITH CIRCUMFLEX
531 #x00FC ;; 159:LATIN SMALL LETTER U WITH DIAERESIS
532 #x2020 ;; 160:DAGGER
533 #x00B0 ;; 161:DEGREE SIGN
534 #x00A2 ;; 162:CENT SIGN
535 #x00A3 ;; 163:POUND SIGN
536 #x00A7 ;; 164:SECTION SIGN
537 #x2022 ;; 165:BULLET
538 #x00B6 ;; 166:PILCROW SIGN
539 #x00DF ;; 167:LATIN SMALL LETTER SHARP S
540 #x00AE ;; 168:REGISTERED SIGN
541 #x00A9 ;; 169:COPYRIGHT SIGN
542 #x2122 ;; 170:TRADE MARK SIGN
543 #x00B4 ;; 171:ACUTE ACCENT
544 #x00A8 ;; 172:DIAERESIS
545 #x2260 ;; 173:NOT EQUAL TO
546 #x00C6 ;; 174:LATIN CAPITAL LETTER AE
547 #x00D8 ;; 175:LATIN CAPITAL LETTER O WITH STROKE
548 #x221E ;; 176:INFINITY
549 #x00B1 ;; 177:PLUS-MINUS SIGN
550 #x2264 ;; 178:LESS-THAN OR EQUAL TO
551 #x2265 ;; 179:GREATER-THAN OR EQUAL TO
552 #x00A5 ;; 180:YEN SIGN
553 #x00B5 ;; 181:MICRO SIGN
554 #x2202 ;; 182:PARTIAL DIFFERENTIAL
555 #x2211 ;; 183:N-ARY SUMMATION
556 #x220F ;; 184:N-ARY PRODUCT
557 #x03C0 ;; 185:GREEK SMALL LETTER PI
558 #x222B ;; 186:INTEGRAL
559 #x00AA ;; 187:FEMININE ORDINAL INDICATOR
560 #x00BA ;; 188:MASCULINE ORDINAL INDICATOR
561 #x03A9 ;; 189:GREEK CAPITAL LETTER OMEGA
562 #x00E6 ;; 190:LATIN SMALL LETTER AE
563 #x00F8 ;; 191:LATIN SMALL LETTER O WITH STROKE
564 #x00BF ;; 192:INVERTED QUESTION MARK
565 #x00A1 ;; 193:INVERTED EXCLAMATION MARK
566 #x00AC ;; 194:NOT SIGN
567 #x221A ;; 195:SQUARE ROOT
568 #x0192 ;; 196:LATIN SMALL LETTER F WITH HOOK
569 #x2248 ;; 197:ALMOST EQUAL TO
570 #x2206 ;; 198:INCREMENT
571 #x00AB ;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
572 #x00BB ;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
573 #x2026 ;; 201:HORIZONTAL ELLIPSIS
574 #x00A0 ;; 202:NO-BREAK SPACE
575 #x00C0 ;; 203:LATIN CAPITAL LETTER A WITH GRAVE
576 #x00C3 ;; 204:LATIN CAPITAL LETTER A WITH TILDE
577 #x00D5 ;; 205:LATIN CAPITAL LETTER O WITH TILDE
578 #x0152 ;; 206:LATIN CAPITAL LIGATURE OE
579 #x0153 ;; 207:LATIN SMALL LIGATURE OE
580 #x2013 ;; 208:EN DASH
581 #x2014 ;; 209:EM DASH
582 #x201C ;; 210:LEFT DOUBLE QUOTATION MARK
583 #x201D ;; 211:RIGHT DOUBLE QUOTATION MARK
584 #x2018 ;; 212:LEFT SINGLE QUOTATION MARK
585 #x2019 ;; 213:RIGHT SINGLE QUOTATION MARK
586 #x00F7 ;; 214:DIVISION SIGN
587 #x25CA ;; 215:LOZENGE
588 #x00FF ;; 216:LATIN SMALL LETTER Y WITH DIAERESIS
589 #x0178 ;; 217:LATIN CAPITAL LETTER Y WITH DIAERESIS
590 #x2044 ;; 218:FRACTION SLASH
591 #x20AC ;; 219:EURO SIGN
592 #x2039 ;; 220:SINGLE LEFT-POINTING ANGLE QUOTATION MARK
593 #x203A ;; 221:SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
594 #xFB01 ;; 222:LATIN SMALL LIGATURE FI
595 #xFB02 ;; 223:LATIN SMALL LIGATURE FL
596 #x2021 ;; 224:DOUBLE DAGGER
597 #x00B7 ;; 225:MIDDLE DOT
598 #x201A ;; 226:SINGLE LOW-9 QUOTATION MARK
599 #x201E ;; 227:DOUBLE LOW-9 QUOTATION MARK
600 #x2030 ;; 228:PER MILLE SIGN
601 #x00C2 ;; 229:LATIN CAPITAL LETTER A WITH CIRCUMFLEX
602 #x00CA ;; 230:LATIN CAPITAL LETTER E WITH CIRCUMFLEX
603 #x00C1 ;; 231:LATIN CAPITAL LETTER A WITH ACUTE
604 #x00CB ;; 232:LATIN CAPITAL LETTER E WITH DIAERESIS
605 #x00C8 ;; 233:LATIN CAPITAL LETTER E WITH GRAVE
606 #x00CD ;; 234:LATIN CAPITAL LETTER I WITH ACUTE
607 #x00CE ;; 235:LATIN CAPITAL LETTER I WITH CIRCUMFLEX
608 #x00CF ;; 236:LATIN CAPITAL LETTER I WITH DIAERESIS
609 #x00CC ;; 237:LATIN CAPITAL LETTER I WITH GRAVE
610 #x00D3 ;; 238:LATIN CAPITAL LETTER O WITH ACUTE
611 #x00D4 ;; 239:LATIN CAPITAL LETTER O WITH CIRCUMFLEX
612 #xF8FF ;; 240:Apple logo
613 #x00D2 ;; 241:LATIN CAPITAL LETTER O WITH GRAVE
614 #x00DA ;; 242:LATIN CAPITAL LETTER U WITH ACUTE
615 #x00DB ;; 243:LATIN CAPITAL LETTER U WITH CIRCUMFLEX
616 #x00D9 ;; 244:LATIN CAPITAL LETTER U WITH GRAVE
617 #x0131 ;; 245:LATIN SMALL LETTER DOTLESS I
618 #x02C6 ;; 246:MODIFIER LETTER CIRCUMFLEX ACCENT
619 #x02DC ;; 247:SMALL TILDE
620 #x00AF ;; 248:MACRON
621 #x02D8 ;; 249:BREVE
622 #x02D9 ;; 250:DOT ABOVE
623 #x02DA ;; 251:RING ABOVE
624 #x00B8 ;; 252:CEDILLA
625 #x02DD ;; 253:DOUBLE ACUTE ACCENT
626 #x02DB ;; 254:OGONEK
627 #x02C7 ;; 255:CARON
628 ])
629 translation-table)
630 (while (< i 128)
631 (aset encoding-vector i i)
632 (setq i (1+ i)))
633 (while (< i 256)
634 (aset encoding-vector i
635 (decode-char 'ucs (aref vec (- i 128))))
636 (setq i (1+ i)))
637 (setq translation-table
638 (make-translation-table-from-vector encoding-vector))
639 (define-translation-table 'mac-roman-decoder translation-table)
a1506d29 640 (define-translation-table 'mac-roman-encoder
71070f12
KH
641 (char-table-extra-slot translation-table 0)))
642
643(define-ccl-program decode-mac-roman
644 `(4
645 ((loop
646 (read r1)
647 (if (r1 < 128) ;; ASCII
648 (r0 = ,(charset-id 'ascii))
546790cb 649 (if (r1 < 160)
71070f12
KH
650 (r0 = ,(charset-id 'eight-bit-control))
651 (r0 = ,(charset-id 'eight-bit-graphic))))
652 (translate-character mac-roman-decoder r0 r1)
653 (write-multibyte-character r0 r1)
654 (repeat))))
655 "CCL program to decode Mac Roman")
656
657(define-ccl-program encode-mac-roman
658 `(1
659 ((loop
660 (read-multibyte-character r0 r1)
57ef7816 661 (translate-character ucs-mule-to-mule-unicode r0 r1)
71070f12 662 (translate-character mac-roman-encoder r0 r1)
d8504583
KH
663 (if (r0 != ,(charset-id 'ascii))
664 (if (r0 != ,(charset-id 'eight-bit-graphic))
665 (if (r0 != ,(charset-id 'eight-bit-control))
666 (r1 = ??))))
71070f12
KH
667 (write-repeat r1))))
668 "CCL program to encode Mac Roman")
669
670(make-coding-system
5ef35063
WL
671 'mac-roman 4 ?M
672 "Mac Roman Encoding (MIME:MACINTOSH)."
71070f12 673 '(decode-mac-roman . encode-mac-roman)
0a5cb0d4
EZ
674 (list (cons 'safe-chars (get 'mac-roman-encoder 'translation-table))
675 '(valid-codes (0 . 255))
676 '(mime-charset . macintosh))) ; per IANA, rfc1345
71070f12 677
5180cc01
DL
678(defconst diacritic-composition-pattern "\\C^\\c^+")
679
5180cc01
DL
680(defun diacritic-compose-region (beg end)
681 "Compose diacritic characters in the region.
682When called from a program, expects two arguments,
683positions (integers or markers) specifying the region."
684 (interactive "r")
685 (save-restriction
686 (narrow-to-region beg end)
687 (goto-char (point-min))
688 (while (re-search-forward diacritic-composition-pattern nil t)
689 (compose-region (match-beginning 0) (match-end 0)))))
690
5180cc01
DL
691(defun diacritic-compose-string (string)
692 "Compose diacritic characters in STRING and return the resulting string."
693 (let ((idx 0))
694 (while (setq idx (string-match diacritic-composition-pattern string idx))
695 (compose-string string idx (match-end 0))
696 (setq idx (match-end 0))))
697 string)
a1506d29 698
5180cc01
DL
699(defun diacritic-compose-buffer ()
700 "Compose diacritic characters in the current buffer."
701 (interactive)
702 (diacritic-compose-region (point-min) (point-max)))
703
5180cc01
DL
704(defun diacritic-post-read-conversion (len)
705 (diacritic-compose-region (point) (+ (point) len))
706 len)
707
5180cc01
DL
708(defun diacritic-composition-function (from to pattern &optional string)
709 "Compose diacritic text in the region FROM and TO.
710The text matches the regular expression PATTERN.
711Optional 4th argument STRING, if non-nil, is a string containing text
712to compose.
713
34b5d116
DL
714The return value is the number of composed characters."
715 (when (< (1+ from) to)
716 (if string
717 (compose-string string from to)
718 (compose-region from to))
719 (- to from)))
5180cc01
DL
720
721;; Register a function to compose Unicode diacrtics and marks.
5f3648c4 722(let ((patterns '(("\\C^\\c^+" . diacritic-composition-function))))
5180cc01
DL
723 (let ((c #x300))
724 (while (<= c #x362)
725 (aset composition-function-table (decode-char 'ucs c) patterns)
726 (setq c (1+ c)))
727 (setq c #x20d0)
728 (while (<= c #x20e3)
729 (aset composition-function-table (decode-char 'ucs c) patterns)
730 (setq c (1+ c)))))
731
27ff18c9
DL
732(provide 'european)
733
ab5796a9 734;;; arch-tag: 9e018b12-fb02-4120-907b-9adeaf84b5c2
4ed46869 735;;; european.el ends here