*** empty log message ***
[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.
fa526c4a 4;; Licensed to the Free Software Foundation.
f15f44a9 5;; Copyright (C) 2001, 2002 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
0859301a
DL
28;; For European scripts, character sets ISO8859-1,2,3,4,9,10,13,14,15,
29;; windows-1250,2,4,7, mac-roman, adobe-standard-encoding, cp850 and
30;; next are supported.
4ed46869
KH
31
32;;; Code:
33
5c4794f3 34;; Latin-1 (ISO-8859-1)
335a7ad7 35
335a7ad7 36(set-language-info-alist
e1915ab3 37 "Latin-1" '((charset iso-8859-1)
3617715a
KH
38 (coding-system iso-latin-1)
39 (coding-priority iso-latin-1)
e1915ab3 40 (nonascii-translation . iso-8859-1)
16b2eb50 41 (unibyte-syntax . "latin-1")
bed54678 42 (unibyte-display . iso-latin-1)
3e56710f 43 (input-method . "latin-1-prefix")
5c4794f3
RS
44 (sample-text
45 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
3617715a 46 (documentation . "\
cce3ba48
DL
47This language environment is a generic one for the Latin-1 (ISO-8859-1)
48character set which supports the following European languages:
49 Albanian, Basque, Breton, Catalan, Danish, Dutch, English, Faeroese,
50 Finnish, French (with restrictions -- see Latin-9), Frisian, Galician,
51 German, Greenlandic, Icelandic, Irish Gaelic (new orthography),
52 Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic,
53 Scottish Gaelic, Spanish, and Swedish.
cd53f29e
KH
54We also have specific language environments for the following languages:
55 For Dutch, \"Dutch\".
56 For German, \"German\".
57 For Spanish, \"Spanish\".
cc01e274 58 For French, \"French\".
cce3ba48
DL
59
60Latin-1 also covers several written languages outside Europe, including
61Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
3617715a
KH
62 '("European"))
63
335a7ad7 64\f
5c4794f3 65;; Latin-2 (ISO-8859-2)
335a7ad7 66
e1915ab3
KH
67(define-coding-system 'iso-latin-2
68 "ISO 2022 based 8-bit encoding for Latin-2 (MIME:ISO-8859-2)."
69 :coding-type 'charset
70 :mnemonic ?2
71 :charset-list '(iso-8859-2)
f15f44a9 72 :mime-charset 'iso-8859-2)
4ed46869 73
71eabd24 74(define-coding-system-alias 'iso-8859-2 'iso-latin-2)
300c450d 75(define-coding-system-alias 'latin-2 'iso-latin-2)
4b9121fc 76
335a7ad7 77(set-language-info-alist
e1915ab3 78 "Latin-2" '((charset iso-8859-2)
3617715a
KH
79 (coding-system iso-latin-2)
80 (coding-priority iso-latin-2)
e1915ab3 81 (nonascii-translation . iso-8859-2)
16b2eb50 82 (unibyte-syntax . "latin-2")
bed54678 83 (unibyte-display . iso-latin-2)
3e56710f 84 (input-method . "latin-2-prefix")
3617715a 85 (documentation . "\
cce3ba48 86This language environment is a generic one for the Latin-2 (ISO-8859-2)
e325120d 87character set which supports the following languages:
60763153 88 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
59c1ccf2 89 Serbo-Croatian or Croatian, Slovak, Slovene, Sorbian (upper and lower),
e325120d
KH
90 and Swedish.
91We also have specific language environments for the following languages:
92 For Czech, \"Czech\".
93 For Romanian, \"Romanian\".
94 For Slovak, \"Slovak\"."))
3617715a
KH
95 '("European"))
96
335a7ad7 97\f
5c4794f3 98;; Latin-3 (ISO-8859-3)
335a7ad7 99
e1915ab3
KH
100(define-coding-system 'iso-latin-3
101 "ISO 2022 based 8-bit encoding for Latin-3 (MIME:ISO-8859-3)."
102 :coding-type 'charset
103 :mnemonic ?3
104 :charset-list '(iso-8859-3)
f15f44a9 105 :mime-charset 'iso-8859-3)
4ed46869 106
71eabd24 107(define-coding-system-alias 'iso-8859-3 'iso-latin-3)
300c450d 108(define-coding-system-alias 'latin-3 'iso-latin-3)
4b9121fc 109
335a7ad7 110(set-language-info-alist
e1915ab3 111 "Latin-3" '((charset iso-8859-3)
3617715a
KH
112 (coding-system iso-latin-3)
113 (coding-priority iso-latin-3)
e1915ab3 114 (nonascii-translation . iso-8859-3)
16b2eb50 115 (unibyte-syntax . "latin-3")
bed54678 116 (unibyte-display . iso-latin-3)
3e56710f 117 (input-method . "latin-3-prefix")
3617715a 118 (documentation . "\
60763153
RS
119These languages are supported with the Latin-3 (ISO-8859-3) character set:
120 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
3617715a
KH
121 German, Italian, Maltese, Spanish, and Turkish."))
122 '("European"))
123
335a7ad7 124\f
5c4794f3 125;; Latin-4 (ISO-8859-4)
335a7ad7 126
e1915ab3
KH
127(define-coding-system 'iso-latin-4
128 "ISO 2022 based 8-bit encoding for Latin-4 (MIME:ISO-8859-4)."
129 :coding-type 'charset
130 :mnemonic ?4
131 :charset-list '(iso-8859-4)
f15f44a9 132 :mime-charset 'iso-8859-4)
4ed46869 133
71eabd24 134(define-coding-system-alias 'iso-8859-4 'iso-latin-4)
300c450d 135(define-coding-system-alias 'latin-4 'iso-latin-4)
4b9121fc 136
335a7ad7 137(set-language-info-alist
e1915ab3 138 "Latin-4" '((charset iso-8859-4)
3617715a
KH
139 (coding-system iso-8859-4)
140 (coding-priority iso-8859-4)
e1915ab3 141 (nonascii-translation . iso-8859-4)
16b2eb50 142 (unibyte-syntax . "latin-4")
bed54678 143 (unibyte-display . iso-8859-4)
11f340ed 144 (input-method . "latin-4-postfix")
3617715a 145 (documentation . "\
60763153
RS
146These languages are supported with the Latin-4 (ISO-8859-4) character set:
147 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
3617715a
KH
148 Latvian, Lithuanian, and Norwegian."))
149 '("European"))
150
335a7ad7 151\f
5c4794f3 152;; Latin-5 (ISO-8859-9)
335a7ad7 153
e1915ab3
KH
154(define-coding-system 'iso-latin-5
155 "ISO 2022 based 8-bit encoding for Latin-5 (MIME:ISO-8859-9)."
156 :coding-type 'charset
157 :mnemonic ?9
158 :charset-list '(iso-8859-9)
f15f44a9 159 :mime-charset 'iso-8859-9)
4ed46869 160
71eabd24 161(define-coding-system-alias 'iso-8859-9 'iso-latin-5)
300c450d 162(define-coding-system-alias 'latin-5 'iso-latin-5)
4b9121fc 163
3617715a 164(set-language-info-alist
e1915ab3 165 "Latin-5" '((charset iso-8859-9)
3617715a
KH
166 (coding-system iso-latin-5)
167 (coding-priority iso-latin-5)
e1915ab3 168 (nonascii-translation . iso-8859-9)
16b2eb50 169 (unibyte-syntax . "latin-5")
bed54678 170 (unibyte-display . iso-latin-5)
11f340ed 171 (input-method . "latin-5-postfix")
b24cd22e 172 (documentation . "Support for Turkish language."))
cce3ba48
DL
173 '("European"))
174
175\f
0859301a
DL
176;; Latin-6 (ISO-8859-10)
177
178(define-coding-system 'iso-latin-6
179 "ISO 2022 based 8-bit encoding for Latin-6 (MIME:ISO-8859-10)."
180 :coding-type 'charset
181 :mnemonic ?9
182 :charset-list '(iso-8859-10)
183 :mime-charset 'iso-8859-10)
184
185(define-coding-system-alias 'iso-8859-10 'iso-latin-6)
186(define-coding-system-alias 'latin-6 'iso-latin-6)
187
188(set-language-info-alist
189 "Latin-6" '((charset iso-8859-10)
190 (coding-system iso-latin-6)
191 (coding-priority iso-latin-6)
192 (nonascii-translation . iso-8859-10)
193 (unibyte-syntax . "latin-6")
194 (unibyte-display . iso-latin-6)
195 ;; Fixme: input method.
196 (documentation . "Support for generic Latin-6 (Northern European)."))
197 '("European"))
198
199\f
200;; Latin-7 (ISO-8859-13)
201
202(define-coding-system 'iso-latin-7
203 "ISO 2022 based 8-bit encoding for Latin-7 (MIME:ISO-8859-13)."
204 :coding-type 'charset
205 :mnemonic ?9
206 :charset-list '(iso-8859-13)
207 :mime-charset 'iso-8859-13)
208
209(define-coding-system-alias 'iso-8859-13 'iso-latin-7)
210(define-coding-system-alias 'latin-7 'iso-latin-7)
211
212(set-language-info-alist
213 "Latin-7" '((charset iso-8859-13)
214 (coding-system iso-latin-7)
215 (coding-priority iso-latin-7)
216 (nonascii-translation . iso-8859-13)
217 (unibyte-syntax . "latin-7")
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
DL
241 (unibyte-syntax . "latin-8")
242 (unibyte-display . iso-latin-8)
27ff18c9
DL
243 (input-method . "latin-8-prefix")
244 ;; Fixme: Welsh/Ga{e}lic greetings
245 (sample-text . "\e,_"\e(B \e,_p\e(B \e,_^\e(B")
cce3ba48
DL
246 (documentation . "\
247This language environment is a generic one for the Latin-8 (ISO-8859-14)
27ff18c9 248character set which supports the Celtic languages, including those not
5ef35063
WL
249covered by other ISO-8859 character sets:
250 Welsh, Manx Gaelic and Irish Gaelic (old orthography)."))
3617715a 251 '("European"))
cce3ba48
DL
252\f
253;; Latin-9 (ISO-8859-15)
254
e1915ab3
KH
255(define-coding-system 'iso-latin-9
256 "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)."
257 :coding-type 'charset
258 ;; `0' for `Latin-0'
259 :mnemonic ?0
260 :charset-list '(iso-8859-15)
f15f44a9 261 :mime-charset 'iso-8859-15)
cce3ba48
DL
262
263(define-coding-system-alias 'iso-8859-15 'iso-latin-9)
264(define-coding-system-alias 'latin-9 'iso-latin-9)
265(define-coding-system-alias 'latin-0 'iso-latin-9)
3617715a 266
cce3ba48 267(set-language-info-alist
e1915ab3 268 "Latin-9" '((charset iso-8859-15)
cce3ba48
DL
269 (coding-system iso-latin-9)
270 (coding-priority iso-latin-9)
e1915ab3 271 (nonascii-translation . iso-8859-15)
cce3ba48
DL
272 (unibyte-syntax . "latin-9")
273 (unibyte-display . iso-latin-9)
27ff18c9 274 (input-method . "latin-9-prefix")
cce3ba48 275 (sample-text
f15f44a9 276 . "AVE. \e,B)9.>\e,b<=\e,_/\e(B \e,b$\e(B")
cce3ba48
DL
277 (documentation . "\
278This language environment is a generic one for the Latin-9 (ISO-8859-15)
279character set which supports the same languages as Latin-1 with the
280addition of the Euro sign and some additional French and Finnish letters.
281Latin-9 is sometimes nicknamed `Latin-0'."))
282 '("European"))
3617715a 283\f
accf24cd
DL
284(define-coding-system 'iso-latin-7
285 "ISO 2022 based 8-bit encoding for Latin-7 (MIME:ISO-8859-13)."
286 :coding-type 'charset
287 ;; `0' for `Latin-0'
288 :mnemonic ?*
289 :charset-list '(iso-8859-13)
290 :mime-charset 'iso-8859-13)
291
292(define-coding-system-alias 'iso-8859-13 'iso-latin-7)
293(define-coding-system-alias 'latin-7 'iso-latin-7)
294\f
295(define-coding-system 'windows-1250
296 "windows-1250 (Central European) encoding (MIME: WINDOWS-1250)"
297 :coding-type 'charset
298 :mnemonic ?*
299 :charset-list '(windows-1250)
300 :mime-charset 'windows-1250)
301(define-coding-system-alias 'cp1250 'windows-1250)
302
06d5cc88 303(define-coding-system 'windows-1252
accf24cd 304 "windows-1252 (Western European) encoding (MIME: WINDOWS-1252)"
06d5cc88
DL
305 :coding-type 'charset
306 :mnemonic ?*
307 :charset-list '(windows-1252)
308 :mime-charset 'windows-1252)
309(define-coding-system-alias 'cp1252 'windows-1252)
accf24cd
DL
310
311(define-coding-system 'windows-1254
312 "windows-1254 (Turkish) encoding (MIME: WINDOWS-1254)"
313 :coding-type 'charset
314 :mnemonic ?*
315 :charset-list '(windows-1254)
316 :mime-charset 'windows-1254)
317(define-coding-system-alias 'cp1254 'windows-1254)
318
319(define-coding-system 'windows-1257
320 "windows-1257 (Baltic) encoding (MIME: WINDOWS-1257)"
321 :coding-type 'charset
322 :mnemonic ?*
323 :charset-list '(windows-1257)
324 :mime-charset 'windows-1257)
325(define-coding-system-alias 'cp1257 'windows-1257)
0859301a
DL
326
327(define-coding-system 'cp850
328 "DOS codepage 850 (Western European)"
329 :coding-type 'charset
330 :mnemonic ?D
331 :charset-list '(cp850)
332 :mime-charset 'cp850)
333(define-coding-system-alias 'ibm850 'cp850)
06d5cc88 334\f
4ed46869 335(set-language-info-alist
bed54678 336 "German" '((tutorial . "TUTORIAL.de")
e1915ab3 337 (charset iso-8859-1)
3617715a
KH
338 (coding-system iso-latin-1)
339 (coding-priority iso-latin-1)
e1915ab3 340 (nonascii-translation . iso-8859-1)
3e56710f 341 (input-method . "german-postfix")
16b2eb50 342 (unibyte-syntax . "latin-1")
bed54678 343 (unibyte-display . iso-latin-1)
3617715a
KH
344 (sample-text . "\
345German (Deutsch Nord) Guten Tag
346German (Deutsch S\e,A|\e(Bd) Gr\e,A|_\e(B Gott")
347 (documentation . "\
348This language environment is almost the same as Latin-1,
70a4f3ea
WL
349but sets the default input method to \"german-postfix\".
350Additionally, it selects the German tutorial."))
3617715a 351 '("European"))
8dfef503 352
fdd2d14d
EZ
353(set-language-info-alist
354 "French" '((tutorial . "TUTORIAL.fr")
e1915ab3 355 (charset iso-8859-1)
fdd2d14d
EZ
356 (coding-system iso-latin-1)
357 (coding-priority iso-latin-1)
e1915ab3 358 (nonascii-translation . iso-8859-1)
fdd2d14d
EZ
359 (unibyte-syntax . "latin-1")
360 (unibyte-display . iso-latin-1)
361 (input-method . "latin-1-prefix")
362 (sample-text . "French (Fran\e,Ag\e(Bais) Bonjour, Salut")
363 (documentation . "\
364This language environment is almost the same as Latin-1,
70a4f3ea 365but it selects the French tutorial."))
fdd2d14d
EZ
366 '("European"))
367
e0980142 368(set-language-info-alist
e1915ab3 369 "Slovenian" '((charset iso-8859-2)
e0980142
RS
370 (coding-system . (iso-8859-2))
371 (coding-priority . (iso-8859-2))
e1915ab3 372 (nonascii-translation . iso-8859-2)
e0980142
RS
373 (input-method . "latin-2-postfix")
374 (unibyte-syntax . "latin-2")
375 (unibyte-display . iso-8859-2)
376 (tutorial . "TUTORIAL.sl")
377 (sample-text . "\e,B.\e(Belimo vam uspe\e,B9\e(Ben dan!")
378 (documentation . t))
379 '("European"))
380
891258f2
GM
381(set-language-info-alist
382 "Spanish" '((tutorial . "TUTORIAL.es")
e1915ab3 383 (charset iso-8859-1)
891258f2
GM
384 (coding-system iso-latin-1)
385 (coding-priority iso-latin-1)
e1915ab3 386 (nonascii-translation . iso-8859-1)
891258f2 387 (input-method . "spanish-postfix")
891258f2
GM
388 (unibyte-syntax . "latin-1")
389 (unibyte-display . iso-latin-1)
390 (sample-text . "Spanish (Espa\e,Aq\e(Bol) \e,A!\e(BHola!")
391 (documentation . "\
392This language environment is almost the same as Latin-1,
70a4f3ea 393but it sets the default input method to \"spanish-postfix\",
a959e723 394and it selects the Spanish tutorial."))
891258f2
GM
395 '("European"))
396
397(set-language-info-alist
398 "Dutch" '((tutorial . "TUTORIAL.nl")
e1915ab3 399 (charset iso-8859-1)
891258f2
GM
400 (coding-system iso-latin-1)
401 (coding-priority iso-latin-1)
e1915ab3 402 (nonascii-translation . iso-8859-1)
891258f2
GM
403 (unibyte-syntax . "latin-1")
404 (unibyte-display . iso-latin-1)
405 (sample-text . "Er is een aantal manieren waarop je dit kan doen")
406 (documentation . "\
407This language environment is almost the same as Latin-1,
70a4f3ea 408but it selects the Dutch tutorial."))
891258f2
GM
409 '("European"))
410
d22c4fb9
KH
411;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
412;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
413;; was used for Turkish. Those who use Latin-3 for Turkish should use
414;; "Latin-3" language environment.
415
416(set-language-info-alist
e1915ab3 417 "Turkish" '((charset iso-8859-9)
d22c4fb9
KH
418 (coding-system iso-latin-5)
419 (coding-priority iso-latin-5)
e1915ab3 420 (nonascii-translation . iso-8859-9)
d22c4fb9
KH
421 (unibyte-syntax . "latin-5")
422 (unibyte-display . iso-latin-5)
423 (input-method . "turkish-postfix")
f15f44a9 424 (sample-text . "Turkish (T\e,A|\e(Brk\e,Ag\e(Be) Merhaba")
d22c4fb9
KH
425 (documentation . t)))
426
b9427ca6
KH
427;; Polish ISO 8859-2 environment.
428;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
429;; Keywords: multilingual, Polish
430
b9427ca6 431(set-language-info-alist
e1915ab3 432 "Polish" '((charset . (iso-8859-2))
b9427ca6
KH
433 (coding-system . (iso-8859-2))
434 (coding-priority . (iso-8859-2))
e1915ab3 435 (nonascii-translation . iso-8859-2)
b9427ca6 436 (input-method . "polish-slash")
b9427ca6
KH
437 (unibyte-syntax . "latin-2")
438 (unibyte-display . iso-8859-2)
439 (tutorial . "TUTORIAL.pl")
f15f44a9 440 (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
441 (documentation . t))
442 '("European"))
443
3286933f
DL
444(set-language-info-alist
445 "Welsh" `((coding-system utf-8 latin-8) ; the input method is Unicode-based
446 (coding-priority utf-8 latin-8)
e1915ab3 447 (nonascii-translation . iso-8859-14)
3286933f
DL
448 (input-method . "welsh")
449 (documentation . "Support for Welsh, using Unicode."))
450 '("European"))
451
452(set-language-info-alist
453 "Latin-7" `((coding-system latin-7)
454 (coding-priority latin-7)
e1915ab3 455 (nonascii-translation . iso-8859-13)
3286933f 456 ;; Fixme: input-method
3286933f
DL
457 (documentation . "Support for Latin-7, e.g. Latvian, Lithuanian."))
458 '("European"))
459
460(set-language-info-alist
461 "Lithuanian" `((coding-system latin-7)
462 (coding-priority latin-7)
e1915ab3 463 (nonascii-translation . iso-8859-13)
3286933f 464 (input-method . "lithuanian-keyboard")
3286933f
DL
465 (documentation . "Support for Lithuanian."))
466 '("European"))
467
468(set-language-info-alist
469 "Latvian" `((coding-system latin-7)
470 (coding-priority latin-7)
e1915ab3 471 (nonascii-translation . iso-8859-13)
3286933f 472 (input-method . "latvian-keyboard")
3286933f
DL
473 (documentation . "Support for Latvian."))
474 '("European"))
e1915ab3 475
71070f12 476\f
e1915ab3
KH
477(define-coding-system 'mac-roman
478 "Mac Roman Encoding (MIME:MACINTOSH)."
479 :coding-type 'charset
480 :mnemonic ?M
481 :charset-list '(mac-roman)
e1915ab3 482 :mime-charset 'macintosh)
71070f12 483
accf24cd
DL
484(define-coding-system 'next
485 "NeXTstep encoding"
486 :coding-type 'charset
487 :mnemonic ?*
488 :charset-list '(next)
489 :mime-charset 'next)
0859301a
DL
490
491(define-coding-system 'hp-roman8
492 "Hewlet-Packard roman-8 encoding (MIME:ROMAN-8)"
493 :coding-type 'charset
494 :mnemonic ?*
495 :charset-list '(hp-roman8)
496 :mime-charset 'hp-roman8)
497(define-coding-system-alias 'roman8 'hp-roman8)
498
499(define-coding-system 'adobe-standard-encoding
500 "Adobe `standard' encoding for PostScript"
501 :coding-type 'charset
502 :mnemonic ?*
503 :charset-list '(adobe-standard-encoding) 'adobe-standard-encoding)
accf24cd 504\f
5180cc01
DL
505(defconst diacritic-composition-pattern "\\C^\\c^+")
506
5180cc01
DL
507(defun diacritic-compose-region (beg end)
508 "Compose diacritic characters in the region.
509When called from a program, expects two arguments,
510positions (integers or markers) specifying the region."
511 (interactive "r")
512 (save-restriction
513 (narrow-to-region beg end)
514 (goto-char (point-min))
515 (while (re-search-forward diacritic-composition-pattern nil t)
516 (compose-region (match-beginning 0) (match-end 0)))))
517
5180cc01
DL
518(defun diacritic-compose-string (string)
519 "Compose diacritic characters in STRING and return the resulting string."
520 (let ((idx 0))
521 (while (setq idx (string-match diacritic-composition-pattern string idx))
522 (compose-string string idx (match-end 0))
523 (setq idx (match-end 0))))
524 string)
525
5180cc01
DL
526(defun diacritic-compose-buffer ()
527 "Compose diacritic characters in the current buffer."
528 (interactive)
529 (diacritic-compose-region (point-min) (point-max)))
530
5180cc01
DL
531(defun diacritic-post-read-conversion (len)
532 (diacritic-compose-region (point) (+ (point) len))
533 len)
534
5180cc01
DL
535(defun diacritic-composition-function (from to pattern &optional string)
536 "Compose diacritic text in the region FROM and TO.
537The text matches the regular expression PATTERN.
538Optional 4th argument STRING, if non-nil, is a string containing text
539to compose.
540
541The return value is number of composed characters."
542 (if (< (1+ from) to)
543 (prog1 (- to from)
544 (if string
545 (compose-string string from to)
546 (compose-region from to))
547 (- to from))))
548
549;; Register a function to compose Unicode diacrtics and marks.
5f3648c4 550(let ((patterns '(("\\C^\\c^+" . diacritic-composition-function))))
5180cc01
DL
551 (let ((c #x300))
552 (while (<= c #x362)
e1915ab3 553 (aset composition-function-table (decode-char 'unicode c) patterns)
5180cc01
DL
554 (setq c (1+ c)))
555 (setq c #x20d0)
556 (while (<= c #x20e3)
e1915ab3 557 (aset composition-function-table (decode-char 'unicode c) patterns)
5180cc01
DL
558 (setq c (1+ c)))))
559
27ff18c9
DL
560(provide 'european)
561
4ed46869 562;;; european.el ends here