(quoted-printable-decode-region): Insert bytes by `insert-byte'.
[bpt/emacs.git] / lisp / language / european.el
1 ;;; european.el --- support for European languages -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 1995, 1997, 2001 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
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
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.
25
26 ;;; Commentary:
27
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.
31
32 ;;; Code:
33
34 ;; Latin-1 (ISO-8859-1)
35
36 (set-language-info-alist
37 "Latin-1" '((charset iso-8859-1)
38 (coding-system iso-latin-1)
39 (coding-priority iso-latin-1)
40 (nonascii-translation . iso-8859-1)
41 (unibyte-syntax . "latin-1")
42 (unibyte-display . iso-latin-1)
43 (input-method . "latin-1-prefix")
44 (sample-text
45 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
46 (documentation . "\
47 This language environment is a generic one for the Latin-1 (ISO-8859-1)
48 character 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.
54 We also have specific language environments for the following languages:
55 For Dutch, \"Dutch\".
56 For German, \"German\".
57 For Spanish, \"Spanish\".
58 For French, \"French\".
59
60 Latin-1 also covers several written languages outside Europe, including
61 Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
62 '("European"))
63
64 \f
65 ;; Latin-2 (ISO-8859-2)
66
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)
72 :mime-charset 'iso-8859-2)
73
74 (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
75 (define-coding-system-alias 'latin-2 'iso-latin-2)
76
77 (set-language-info-alist
78 "Latin-2" '((charset iso-8859-2)
79 (coding-system iso-latin-2)
80 (coding-priority iso-latin-2)
81 (nonascii-translation . iso-8859-2)
82 (unibyte-syntax . "latin-2")
83 (unibyte-display . iso-latin-2)
84 (input-method . "latin-2-prefix")
85 (documentation . "\
86 This language environment is a generic one for the Latin-2 (ISO-8859-2)
87 character set which supports the following languages:
88 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
89 Serbo-Croatian or Croatian, Slovak, Slovene, Sorbian (upper and lower),
90 and Swedish.
91 We also have specific language environments for the following languages:
92 For Czech, \"Czech\".
93 For Romanian, \"Romanian\".
94 For Slovak, \"Slovak\"."))
95 '("European"))
96
97 \f
98 ;; Latin-3 (ISO-8859-3)
99
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)
105 :mime-charset 'iso-8859-3)
106
107 (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
108 (define-coding-system-alias 'latin-3 'iso-latin-3)
109
110 (set-language-info-alist
111 "Latin-3" '((charset iso-8859-3)
112 (coding-system iso-latin-3)
113 (coding-priority iso-latin-3)
114 (nonascii-translation . iso-8859-3)
115 (unibyte-syntax . "latin-3")
116 (unibyte-display . iso-latin-3)
117 (input-method . "latin-3-prefix")
118 (documentation . "\
119 These languages are supported with the Latin-3 (ISO-8859-3) character set:
120 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
121 German, Italian, Maltese, Spanish, and Turkish."))
122 '("European"))
123
124 \f
125 ;; Latin-4 (ISO-8859-4)
126
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)
132 :mime-charset 'iso-8859-4)
133
134 (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
135 (define-coding-system-alias 'latin-4 'iso-latin-4)
136
137 (set-language-info-alist
138 "Latin-4" '((charset iso-8859-4)
139 (coding-system iso-8859-4)
140 (coding-priority iso-8859-4)
141 (nonascii-translation . iso-8859-4)
142 (unibyte-syntax . "latin-4")
143 (unibyte-display . iso-8859-4)
144 (input-method . "latin-4-postfix")
145 (documentation . "\
146 These languages are supported with the Latin-4 (ISO-8859-4) character set:
147 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
148 Latvian, Lithuanian, and Norwegian."))
149 '("European"))
150
151 \f
152 ;; Latin-5 (ISO-8859-9)
153
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)
159 :mime-charset 'iso-8859-9)
160
161 (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
162 (define-coding-system-alias 'latin-5 'iso-latin-5)
163
164 (set-language-info-alist
165 "Latin-5" '((charset iso-8859-9)
166 (coding-system iso-latin-5)
167 (coding-priority iso-latin-5)
168 (nonascii-translation . iso-8859-9)
169 (unibyte-syntax . "latin-5")
170 (unibyte-display . iso-latin-5)
171 (input-method . "latin-5-postfix")
172 (documentation . "Support for Turkish language."))
173 '("European"))
174
175 \f
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
223 ;; Latin-8 (ISO-8859-14)
224
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)
231 :mime-charset 'iso-8859-14)
232
233 (define-coding-system-alias 'iso-8859-14 'iso-latin-8)
234 (define-coding-system-alias 'latin-8 'iso-latin-8)
235
236 (set-language-info-alist
237 "Latin-8" '((charset iso-8859-14)
238 (coding-system iso-latin-8)
239 (coding-priority iso-latin-8)
240 (nonascii-translation . iso-8859-14)
241 (unibyte-syntax . "latin-8")
242 (unibyte-display . iso-latin-8)
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")
246 (documentation . "\
247 This language environment is a generic one for the Latin-8 (ISO-8859-14)
248 character set which supports the Celtic languages, including those not
249 covered by other ISO-8859 character sets:
250 Welsh, Manx Gaelic and Irish Gaelic (old orthography)."))
251 '("European"))
252 \f
253 ;; Latin-9 (ISO-8859-15)
254
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)
261 :mime-charset 'iso-8859-15)
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)
266
267 (set-language-info-alist
268 "Latin-9" '((charset iso-8859-15)
269 (coding-system iso-latin-9)
270 (coding-priority iso-latin-9)
271 (nonascii-translation . iso-8859-15)
272 (unibyte-syntax . "latin-9")
273 (unibyte-display . iso-latin-9)
274 (input-method . "latin-9-prefix")
275 (sample-text
276 . "AVE. \e,B)9.>\e,b<=\e,_/\e(B \e,b$\e(B")
277 (documentation . "\
278 This language environment is a generic one for the Latin-9 (ISO-8859-15)
279 character set which supports the same languages as Latin-1 with the
280 addition of the Euro sign and some additional French and Finnish letters.
281 Latin-9 is sometimes nicknamed `Latin-0'."))
282 '("European"))
283 \f
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
303 (define-coding-system 'windows-1252
304 "windows-1252 (Western European) encoding (MIME: WINDOWS-1252)"
305 :coding-type 'charset
306 :mnemonic ?*
307 :charset-list '(windows-1252)
308 :mime-charset 'windows-1252)
309 (define-coding-system-alias 'cp1252 'windows-1252)
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)
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)
334
335 (define-coding-system 'cp852
336 "DOS codepage 852 (Slavic)"
337 :coding-type 'charset
338 :mnemonic ?D
339 :charset-list '(cp852)
340 :mime-charset 'cp852)
341 (define-coding-system-alias 'ibm852 'cp852)
342
343 (define-coding-system 'cp857
344 "DOS codepage 857 (Turkish)"
345 :coding-type 'charset
346 :mnemonic ?D
347 :charset-list '(cp857)
348 :mime-charset 'cp857)
349 (define-coding-system-alias 'ibm857 'cp857)
350
351 (define-coding-system 'cp860
352 "DOS codepage 860 (Portuguese)"
353 :coding-type 'charset
354 :mnemonic ?D
355 :charset-list '(cp860)
356 :mime-charset 'cp860)
357 (define-coding-system-alias 'ibm860 'cp860)
358
359 (define-coding-system 'cp861
360 "DOS codepage 861 (Icelandic)"
361 :coding-type 'charset
362 :mnemonic ?D
363 :charset-list '(cp861)
364 :mime-charset 'cp861)
365 (define-coding-system-alias 'ibm861 'cp861)
366
367 (define-coding-system 'cp863
368 "DOS codepage 863 (French Canadian)"
369 :coding-type 'charset
370 :mnemonic ?D
371 :charset-list '(cp863)
372 :mime-charset 'cp863)
373 (define-coding-system-alias 'ibm863 'cp863)
374
375 (define-coding-system 'cp865
376 "DOS codepage 865 (Norwegian/Danish)"
377 :coding-type 'charset
378 :mnemonic ?D
379 :charset-list '(cp865)
380 :mime-charset 'cp865)
381 (define-coding-system-alias 'ibm865 'cp865)
382
383 (define-coding-system 'cp437
384 "DOS codepage 437"
385 :coding-type 'charset
386 :mnemonic ?D
387 :charset-list '(cp437)
388 :mime-charset 'cp437)
389 (define-coding-system-alias 'ibm437 'cp437)
390 \f
391 (set-language-info-alist
392 "German" '((tutorial . "TUTORIAL.de")
393 (charset iso-8859-1)
394 (coding-system iso-latin-1 iso-latin-9)
395 (coding-priority iso-latin-1)
396 (nonascii-translation . iso-8859-1)
397 (input-method . "german-postfix")
398 (unibyte-syntax . "latin-1")
399 (unibyte-display . iso-latin-1)
400 (sample-text . "\
401 German (Deutsch Nord) Guten Tag
402 German (Deutsch S\e,A|\e(Bd) Gr\e,A|_\e(B Gott")
403 (documentation . "\
404 This language environment is almost the same as Latin-1,
405 but sets the default input method to \"german-postfix\".
406 Additionally, it selects the German tutorial."))
407 '("European"))
408
409 (set-language-info-alist
410 "French" '((tutorial . "TUTORIAL.fr")
411 (charset iso-8859-1)
412 (coding-system iso-latin-1 iso-latin-9)
413 (coding-priority iso-latin-1)
414 (nonascii-translation . iso-8859-1)
415 (unibyte-syntax . "latin-1")
416 (unibyte-display . iso-latin-1)
417 (input-method . "latin-1-prefix")
418 (sample-text . "French (Fran\e,Ag\e(Bais) Bonjour, Salut")
419 (documentation . "\
420 This language environment is almost the same as Latin-1,
421 but it selects the French tutorial."))
422 '("European"))
423
424 (set-language-info-alist
425 "Slovenian" '((charset iso-8859-2)
426 (coding-system . (iso-8859-2 windows-1250))
427 (coding-priority . (iso-8859-2))
428 (nonascii-translation . iso-8859-2)
429 (input-method . "latin-2-postfix")
430 (unibyte-syntax . "latin-2")
431 (unibyte-display . iso-8859-2)
432 (tutorial . "TUTORIAL.sl")
433 (sample-text . "\e,B.\e(Belimo vam uspe\e,B9\e(Ben dan!")
434 (documentation . t))
435 '("European"))
436
437 (set-language-info-alist
438 "Spanish" '((tutorial . "TUTORIAL.es")
439 (charset iso-8859-1)
440 (coding-system iso-latin-1 iso-latin-9)
441 (coding-priority iso-latin-1)
442 (nonascii-translation . iso-8859-1)
443 (input-method . "spanish-postfix")
444 (unibyte-syntax . "latin-1")
445 (unibyte-display . iso-latin-1)
446 (sample-text . "Spanish (Espa\e,Aq\e(Bol) \e,A!\e(BHola!")
447 (documentation . "\
448 This language environment is almost the same as Latin-1,
449 but it sets the default input method to \"spanish-postfix\",
450 and it selects the Spanish tutorial."))
451 '("European"))
452
453 (set-language-info-alist
454 "Dutch" '((tutorial . "TUTORIAL.nl")
455 (charset iso-8859-1)
456 (coding-system iso-latin-1 iso-latin-9)
457 (coding-priority iso-latin-1)
458 (nonascii-translation . iso-8859-1)
459 (unibyte-syntax . "latin-1")
460 (unibyte-display . iso-latin-1)
461 (input-method . "dutch")
462 (sample-text . "Er is een aantal manieren waarop je dit kan doen")
463 (documentation . "\
464 This language environment is almost the same as Latin-1,
465 but it selects the Dutch tutorial and input method."))
466 '("European"))
467
468 ;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
469 ;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
470 ;; was used for Turkish. Those who use Latin-3 for Turkish should use
471 ;; "Latin-3" language environment.
472
473 (set-language-info-alist
474 "Turkish" '((charset iso-8859-9)
475 (coding-system iso-latin-5 windows-1254 iso-latin-3)
476 (coding-priority iso-latin-5)
477 (nonascii-translation . iso-8859-9)
478 (unibyte-syntax . "latin-5")
479 (unibyte-display . iso-latin-5)
480 (input-method . "turkish-postfix")
481 (sample-text . "Turkish (T\e,A|\e(Brk\e,Ag\e(Be) Merhaba")
482 (documentation . t)))
483
484 ;; Polish ISO 8859-2 environment.
485 ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
486 ;; Keywords: multilingual, Polish
487
488 (set-language-info-alist
489 "Polish" '((charset . (iso-8859-2))
490 (coding-system . (iso-8859-2 windows-1250))
491 (coding-priority . (iso-8859-2))
492 (nonascii-translation . iso-8859-2)
493 (input-method . "polish-slash")
494 (unibyte-syntax . "latin-2")
495 (unibyte-display . iso-8859-2)
496 (tutorial . "TUTORIAL.pl")
497 (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")
498 (documentation . t))
499 '("European"))
500
501 (set-language-info-alist
502 "Welsh" `((coding-system utf-8 latin-8) ; the input method is Unicode-based
503 (coding-priority utf-8 latin-8)
504 (nonascii-translation . iso-8859-14)
505 (input-method . "welsh")
506 (documentation . "Support for Welsh, using Unicode."))
507 '("European"))
508
509 (set-language-info-alist
510 "Latin-7" `((coding-system latin-7)
511 (coding-priority latin-7)
512 (nonascii-translation . iso-8859-13)
513 ;; Fixme: input-method
514 (documentation . "Support for Latin-7, e.g. Latvian, Lithuanian."))
515 '("European"))
516
517 (set-language-info-alist
518 "Lithuanian" `((coding-system latin-7 windows-1257)
519 (coding-priority latin-7)
520 (nonascii-translation . iso-8859-13)
521 (input-method . "lithuanian-keyboard")
522 (documentation . "Support for Lithuanian."))
523 '("European"))
524
525 (set-language-info-alist
526 "Latvian" `((coding-system latin-7 windows-1257)
527 (coding-priority latin-7)
528 (nonascii-translation . iso-8859-13)
529 (input-method . "latvian-keyboard")
530 (documentation . "Support for Latvian."))
531 '("European"))
532
533 \f
534 (define-coding-system 'mac-roman
535 "Mac Roman Encoding (MIME:MACINTOSH)."
536 :coding-type 'charset
537 :mnemonic ?M
538 :charset-list '(mac-roman)
539 :mime-charset 'macintosh)
540
541 (define-coding-system 'next
542 "NeXTstep encoding"
543 :coding-type 'charset
544 :mnemonic ?*
545 :charset-list '(next)
546 :mime-charset 'next)
547
548 (define-coding-system 'hp-roman8
549 "Hewlet-Packard roman-8 encoding (MIME:ROMAN-8)"
550 :coding-type 'charset
551 :mnemonic ?*
552 :charset-list '(hp-roman8)
553 :mime-charset 'hp-roman8)
554 (define-coding-system-alias 'roman8 'hp-roman8)
555
556 (define-coding-system 'adobe-standard-encoding
557 "Adobe `standard' encoding for PostScript"
558 :coding-type 'charset
559 :mnemonic ?*
560 :charset-list '(adobe-standard-encoding)
561 :mime-charset 'adobe-standard-encoding)
562 \f
563 (defconst diacritic-composition-pattern "\\C^\\c^+")
564
565 (defun diacritic-compose-region (beg end)
566 "Compose diacritic characters in the region.
567 When called from a program, expects two arguments,
568 positions (integers or markers) specifying the region."
569 (interactive "r")
570 (save-restriction
571 (narrow-to-region beg end)
572 (goto-char (point-min))
573 (while (re-search-forward diacritic-composition-pattern nil t)
574 (compose-region (match-beginning 0) (match-end 0)))))
575
576 (defun diacritic-compose-string (string)
577 "Compose diacritic characters in STRING and return the resulting string."
578 (let ((idx 0))
579 (while (setq idx (string-match diacritic-composition-pattern string idx))
580 (compose-string string idx (match-end 0))
581 (setq idx (match-end 0))))
582 string)
583
584 (defun diacritic-compose-buffer ()
585 "Compose diacritic characters in the current buffer."
586 (interactive)
587 (diacritic-compose-region (point-min) (point-max)))
588
589 (defun diacritic-post-read-conversion (len)
590 (diacritic-compose-region (point) (+ (point) len))
591 len)
592
593 (defun diacritic-composition-function (from to pattern &optional string)
594 "Compose diacritic text in the region FROM and TO.
595 The text matches the regular expression PATTERN.
596 Optional 4th argument STRING, if non-nil, is a string containing text
597 to compose.
598
599 The return value is number of composed characters."
600 (if (< (1+ from) to)
601 (prog1 (- to from)
602 (if string
603 (compose-string string from to)
604 (compose-region from to))
605 (- to from))))
606
607 ;; Register a function to compose Unicode diacrtics and marks.
608 (let ((patterns '(("\\C^\\c^+" . diacritic-composition-function))))
609 (let ((c #x300))
610 (while (<= c #x362)
611 (aset composition-function-table c patterns)
612 (setq c (1+ c)))
613 (setq c #x20d0)
614 (while (<= c #x20e3)
615 (aset composition-function-table c patterns)
616 (setq c (1+ c)))))
617
618 (provide 'european)
619
620 ;;; european.el ends here