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