1 ;;; european.el --- support for European languages -*- coding: iso-2022-7bit; -*-
3 ;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 ;; 2008 Free Software Foundation, Inc.
5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6 ;; 2005, 2006, 2007, 2008
7 ;; National Institute of Advanced Industrial Science and Technology (AIST)
8 ;; Registration Number H14PRO021
10 ;; National Institute of Advanced Industrial Science and Technology (AIST)
11 ;; Registration Number H13PRO009
13 ;; Keywords: multilingual, European
15 ;; This file is part of GNU Emacs.
17 ;; GNU Emacs is free software: you can redistribute it and/or modify
18 ;; it under the terms of the GNU General Public License as published by
19 ;; the Free Software Foundation, either version 3 of the License, or
20 ;; (at your option) any later version.
22 ;; GNU Emacs is distributed in the hope that it will be useful,
23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;; GNU General Public License for more details.
27 ;; You should have received a copy of the GNU General Public License
28 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
32 ;; For European scripts, all the ISO Latin character sets are
33 ;; supported, along with various others.
37 ;; Latin-1 (ISO-8859-1)
39 (set-language-info-alist
40 "Latin-1" '((charset iso-8859-1
)
41 (coding-system iso-latin-1 iso-latin-9 windows-1252
)
42 (coding-priority iso-latin-1
)
43 (nonascii-translation . iso-8859-1
)
44 (unibyte-display . iso-latin-1
)
45 (input-method .
"latin-1-prefix")
47 .
"Hello, Hej, Tere, Hei, Bonjour, Gr\e$(D+d)N\e(B Gott, Ciao, \e$(D"B
\e(BHola!")
49 This language environment is a generic one for the Latin-1
(ISO-8859-1)
50 character 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.
56 We also have specific language environments for the following languages
:
58 For German
, \"German
\".
59 For French
, \"French
\".
60 For Italian
, \"Italian
\".
61 For Slovenian
, \"Slovenian
\".
62 For Spanish
, \"Spanish
\".
64 Latin-1 also covers several written languages outside Europe
, including
65 Indonesian
/Malay
, Tagalog
(Philippines), Swahili and Afrikaans.
"))
69 ;; Latin-2 (ISO-8859-2)
71 (define-coding-system 'iso-latin-2
72 "ISO
2022 based
8-bit encoding for Latin-2
(MIME:ISO-8859-2
).
"
75 :charset-list '(iso-8859-2)
76 :mime-charset 'iso-8859-2)
78 (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
79 (define-coding-system-alias 'latin-2 'iso-latin-2)
81 (set-language-info-alist
82 "Latin-2
" '((charset iso-8859-2)
83 (coding-system iso-latin-2 windows-1250)
84 (coding-priority iso-latin-2)
85 (nonascii-translation . iso-8859-2)
86 (unibyte-display . iso-latin-2)
87 (input-method . "latin-2-prefix
")
89 This language environment is a generic one for the Latin-2
(ISO-8859-2)
90 character set which supports the following languages
:
91 Albanian
, Czech
, English
, German
, Hungarian
, Polish
, Romanian
,
92 Serbo-Croatian or Croatian
, Slovak
, Slovene
, Sorbian
(upper and lower
),
94 We also have specific language environments for the following languages
:
96 For Croatian
, \"Croatian
\".
97 For Polish
, \"Polish
\".
98 For Romanian
, \"Romanian
\".
99 For Slovak
, \"Slovak
\".
"))
103 ;; Latin-3 (ISO-8859-3)
105 (define-coding-system 'iso-latin-3
106 "ISO
2022 based
8-bit encoding for Latin-3
(MIME:ISO-8859-3
).
"
107 :coding-type 'charset
109 :charset-list '(iso-8859-3)
110 :mime-charset 'iso-8859-3)
112 (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
113 (define-coding-system-alias 'latin-3 'iso-latin-3)
115 (set-language-info-alist
116 "Latin-3
" '((charset iso-8859-3)
117 (coding-system iso-latin-3)
118 (coding-priority iso-latin-3)
119 (nonascii-translation . iso-8859-3)
120 (unibyte-display . iso-latin-3)
121 (input-method . "latin-3-prefix
")
123 These languages are supported with the Latin-3
(ISO-8859-3) character set
:
124 Afrikaans
, Catalan
, Dutch
, English
, Esperanto
, French
, Galician
,
125 German
, Italian
, Maltese
, Spanish
, and Turkish.
"))
129 ;; Latin-4 (ISO-8859-4)
131 (define-coding-system 'iso-latin-4
132 "ISO
2022 based
8-bit encoding for Latin-4
(MIME:ISO-8859-4
).
"
133 :coding-type 'charset
135 :charset-list '(iso-8859-4)
136 :mime-charset 'iso-8859-4)
138 (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
139 (define-coding-system-alias 'latin-4 'iso-latin-4)
141 (set-language-info-alist
142 "Latin-4
" '((charset iso-8859-4)
143 (coding-system iso-8859-4)
144 (coding-priority iso-8859-4)
145 (nonascii-translation . iso-8859-4)
146 (unibyte-display . iso-8859-4)
147 (input-method . "latin-4-postfix
")
149 These languages are supported with the Latin-4
(ISO-8859-4) character set
:
150 Danish
, English
, Estonian
, Finnish
, German
, Greenlandic
, Lappish
,
151 Latvian
, Lithuanian
, and Norwegian.
"))
155 ;; Latin-5 (ISO-8859-9)
157 (define-coding-system 'iso-latin-5
158 "ISO
2022 based
8-bit encoding for Latin-5
(MIME:ISO-8859-9
).
"
159 :coding-type 'charset
161 :charset-list '(iso-8859-9)
162 :mime-charset 'iso-8859-9)
164 (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
165 (define-coding-system-alias 'latin-5 'iso-latin-5)
167 (set-language-info-alist
168 "Latin-5
" '((charset iso-8859-9)
169 (coding-system iso-latin-5)
170 (coding-priority iso-latin-5)
171 (nonascii-translation . iso-8859-9)
172 (unibyte-display . iso-latin-5)
173 (input-method . "latin-5-postfix
")
174 (documentation . "Support for Latin-5.\
175 See also the Turkish environment.
"))
179 ;; Latin-6 (ISO-8859-10)
181 (define-coding-system 'iso-latin-6
182 "ISO
2022 based
8-bit encoding for Latin-6
(MIME:ISO-8859-10
).
"
183 :coding-type 'charset
185 :charset-list '(iso-8859-10)
186 :mime-charset 'iso-8859-10)
188 (define-coding-system-alias 'iso-8859-10 'iso-latin-6)
189 (define-coding-system-alias 'latin-6 'iso-latin-6)
191 (set-language-info-alist
192 "Latin-6
" '((charset iso-8859-10)
193 (coding-system iso-latin-6)
194 (coding-priority iso-latin-6)
195 (nonascii-translation . iso-8859-10)
196 (unibyte-display . iso-latin-6)
197 ;; Fixme: input method.
198 (documentation . "Support for generic Latin-6
(Northern European
).
"))
202 ;; Latin-7 (ISO-8859-13)
204 (define-coding-system 'iso-latin-7
205 "ISO
2022 based
8-bit encoding for Latin-7
(MIME:ISO-8859-13
).
"
206 :coding-type 'charset
208 :charset-list '(iso-8859-13)
209 :mime-charset 'iso-8859-13)
211 (define-coding-system-alias 'iso-8859-13 'iso-latin-7)
212 (define-coding-system-alias 'latin-7 'iso-latin-7)
214 (set-language-info-alist
215 "Latin-7
" '((charset iso-8859-13)
216 (coding-system iso-latin-7)
217 (coding-priority iso-latin-7)
218 (nonascii-translation . iso-8859-13)
219 (unibyte-display . iso-latin-7)
220 ;; Fixme: input method.
221 (documentation . "Support for generic Latin-7
(Baltic Rim
).
"))
224 ;; Latin-8 (ISO-8859-14)
226 (define-coding-system 'iso-latin-8
227 "ISO
2022 based
8-bit encoding for Latin-8
(MIME:ISO-8859-14
).
"
228 :coding-type 'charset
229 ;; `W' for `Welsh', since `C' for `Celtic' is taken.
231 :charset-list '(iso-8859-14)
232 :mime-charset 'iso-8859-14)
234 (define-coding-system-alias 'iso-8859-14 'iso-latin-8)
235 (define-coding-system-alias 'latin-8 'iso-latin-8)
237 (set-language-info-alist
238 "Latin-8
" '((charset iso-8859-14)
239 (coding-system iso-latin-8)
240 (coding-priority iso-latin-8)
241 (nonascii-translation . iso-8859-14)
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$(D+q\e(B \e$(D*t\e(B")
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)."))
253 ;; Latin-9 (ISO-8859-15)
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
260 :charset-list
'(iso-8859-15)
261 :mime-charset
'iso-8859-15
)
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
)
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-display . iso-latin-9
)
273 (input-method .
"latin-9-prefix")
275 .
"AVE. \e$(D*^+^*v+v)-)M*s\e(B \e$(Q)!\e(B")
277 This language environment is a generic one for the Latin-9 (ISO-8859-15)
278 character set which supports the same languages as Latin-1 with the
279 addition of the Euro sign and some additional French and Finnish letters.
280 Latin-9 is sometimes nicknamed `Latin-0'."))
283 (set-language-info-alist
284 "Esperanto" '((tutorial .
"TUTORIAL.eo")
286 (coding-system iso-latin-3
)
287 (coding-priority iso-latin-3
)
288 (nonascii-translation . latin-iso8859-3
)
289 (unibyte-syntax .
"latin-3")
290 (unibyte-display . iso-latin-3
)
291 (input-method .
"latin-3-prefix")
292 (documentation .
"Support for Esperanto with ISO-8859-3 character set."))
296 (define-coding-system 'windows-1250
297 "windows-1250 (Central European) encoding (MIME: WINDOWS-1250)"
298 :coding-type
'charset
300 :charset-list
'(windows-1250)
301 :mime-charset
'windows-1250
)
302 (define-coding-system-alias 'cp1250
'windows-1250
)
304 (define-coding-system 'windows-1252
305 "windows-1252 (Western European) encoding (MIME: WINDOWS-1252)"
306 :coding-type
'charset
308 :charset-list
'(windows-1252)
309 :mime-charset
'windows-1252
)
310 (define-coding-system-alias 'cp1252
'windows-1252
)
312 (define-coding-system 'windows-1254
313 "windows-1254 (Turkish) encoding (MIME: WINDOWS-1254)"
314 :coding-type
'charset
316 :charset-list
'(windows-1254)
317 :mime-charset
'windows-1254
)
318 (define-coding-system-alias 'cp1254
'windows-1254
)
320 (define-coding-system 'windows-1257
321 "windows-1257 (Baltic) encoding (MIME: WINDOWS-1257)"
322 :coding-type
'charset
324 :charset-list
'(windows-1257)
325 :mime-charset
'windows-1257
)
326 (define-coding-system-alias 'cp1257
'windows-1257
)
328 (define-coding-system 'cp850
329 "DOS codepage 850 (Western European)"
330 :coding-type
'charset
332 :charset-list
'(cp850)
333 :mime-charset
'cp850
)
334 (define-coding-system-alias 'ibm850
'cp850
)
336 (define-coding-system 'cp852
337 "DOS codepage 852 (Slavic)"
338 :coding-type
'charset
340 :charset-list
'(cp852)
341 :mime-charset
'cp852
)
342 (define-coding-system-alias 'ibm852
'cp852
)
344 (define-coding-system 'cp857
345 "DOS codepage 857 (Turkish)"
346 :coding-type
'charset
348 :charset-list
'(cp857)
349 :mime-charset
'cp857
)
350 (define-coding-system-alias 'ibm857
'cp857
)
352 (define-coding-system 'cp858
353 "Codepage 858 (Multilingual Latin I + Euro)"
354 :coding-type
'charset
356 :charset-list
'(cp858)
357 :mime-charset
'cp858
)
359 (define-coding-system 'cp860
360 "DOS codepage 860 (Portuguese)"
361 :coding-type
'charset
363 :charset-list
'(cp860)
364 :mime-charset
'cp860
)
365 (define-coding-system-alias 'ibm860
'cp860
)
367 (define-coding-system 'cp861
368 "DOS codepage 861 (Icelandic)"
369 :coding-type
'charset
371 :charset-list
'(cp861)
372 :mime-charset
'cp861
)
373 (define-coding-system-alias 'ibm861
'cp861
)
375 (define-coding-system 'cp863
376 "DOS codepage 863 (French Canadian)"
377 :coding-type
'charset
379 :charset-list
'(cp863)
380 :mime-charset
'cp863
)
381 (define-coding-system-alias 'ibm863
'cp863
)
383 (define-coding-system 'cp865
384 "DOS codepage 865 (Norwegian/Danish)"
385 :coding-type
'charset
387 :charset-list
'(cp865)
388 :mime-charset
'cp865
)
389 (define-coding-system-alias 'ibm865
'cp865
)
391 (define-coding-system 'cp437
393 :coding-type
'charset
395 :charset-list
'(cp437)
396 :mime-charset
'cp437
)
397 (define-coding-system-alias 'ibm437
'cp437
)
399 (set-language-info-alist
400 "Dutch" '((tutorial .
"TUTORIAL.nl")
402 (coding-system iso-latin-1 iso-latin-9
)
403 (coding-priority iso-latin-1
)
404 (nonascii-translation . iso-8859-1
)
405 (unibyte-display . iso-latin-1
)
406 (input-method .
"dutch")
407 (sample-text .
"Er is een aantal manieren waarop je dit kan doen")
409 This language environment is almost the same as Latin-1,
410 but it selects the Dutch tutorial and input method."))
413 (set-language-info-alist
414 "German" '((tutorial .
"TUTORIAL.de")
416 (coding-system iso-latin-1 iso-latin-9
)
417 (coding-priority iso-latin-1
)
418 (nonascii-translation . iso-8859-1
)
419 (input-method .
"german-postfix")
420 (unibyte-display . iso-latin-1
)
422 German (Deutsch Nord) Guten Tag
423 German (Deutsch S\e$(D+d\e(Bd) Gr\e$(D+d)N\e(B Gott")
425 This language environment is almost the same as Latin-1,
426 but sets the default input method to \"german-postfix\".
427 Additionally, it selects the German tutorial."))
430 (set-language-info-alist
431 "French" '((tutorial .
"TUTORIAL.fr")
433 (coding-system iso-latin-1 iso-latin-9
)
434 (coding-priority iso-latin-1
)
435 (nonascii-translation . iso-8859-1
)
436 (unibyte-display . iso-latin-1
)
437 (input-method .
"latin-1-prefix")
438 (sample-text .
"French (Fran\e$(D+.\e(Bais) Bonjour, Salut")
440 This language environment is almost the same as Latin-1,
441 but it selects the French tutorial and input method."))
444 (set-language-info-alist
445 "Italian" '((tutorial .
"TUTORIAL.it")
447 (coding-system iso-latin-1 iso-latin-9
)
448 (coding-priority iso-latin-1
)
449 (nonascii-translation . iso-8859-1
)
450 (unibyte-display . iso-latin-1
)
451 (input-method .
"italian-postfix")
452 (sample-text .
"Salve, ciao!")
454 This language environment is almost the same as Latin-1,
455 but sets the default input method to \"italian-postfix\".
456 Additionally, it selects the Italian tutorial."))
459 (set-language-info-alist
460 "Slovenian" '((charset iso-8859-2
)
461 (coding-system .
(iso-8859-2 windows-1250
))
462 (coding-priority .
(iso-8859-2))
463 (nonascii-translation . iso-8859-2
)
464 (input-method .
"slovenian")
465 (unibyte-display . iso-8859-2
)
466 (tutorial .
"TUTORIAL.sl")
467 (sample-text .
"\e$(D*v\e(Belimo vam uspe\e$(D+^\e(Ben dan!")
469 This language environment is almost the same as Latin-2,
470 but it selects the Slovenian tutorial and input method."))
473 (set-language-info-alist
474 "Spanish" '((tutorial .
"TUTORIAL.es")
476 (coding-system iso-latin-1 iso-latin-9
)
477 (coding-priority iso-latin-1
)
478 (input-method .
"spanish-postfix")
479 (nonascii-translation . iso-8859-1
)
480 (unibyte-display . iso-latin-1
)
481 (sample-text .
"Spanish (Espa\e$(D+P\e(Bol) \e$(D"B
\e(BHola!")
483 This language environment is almost the same as Latin-1
,
484 but it sets the default input method to
\"spanish-postfix
\",
485 and it selects the Spanish tutorial.
"))
488 ;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
489 ;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
490 ;; was used for Turkish. Those who use Latin-3 for Turkish should use
491 ;; "Latin-3
" language environment.
493 (set-language-info-alist
494 "Turkish
" '((charset iso-8859-9)
495 (coding-system iso-latin-5 windows-1254 iso-latin-3)
496 (coding-priority iso-latin-5)
497 (nonascii-translation . iso-8859-9)
498 (unibyte-display . iso-latin-5)
499 (input-method . "turkish-postfix
")
500 (sample-text . "Turkish
(T\e$
(D+d
\e(Brk\e$
(D+.
\e(Be) Merhaba
")
501 (setup-function . turkish-case-conversion-enable)
502 (setup-function . turkish-case-conversion-disable)
503 (documentation . "Support for Turkish.
504 Differs from the Latin-5 environment in using the
`turkish-postfix
' input
505 method and applying Turkish case rules for the characters i
, I
, \e$
(D)E
\e(B, \e$
(D*D
\e(B.
")))
507 (defun turkish-case-conversion-enable ()
508 "Set up Turkish case conversion of
`i
' and
`I
' into
`\e$
(D*D
\e(B' and
`\e$
(D)E
\e(B'.
"
509 (let ((table (standard-case-table)))
510 (set-case-syntax-pair ?\e$(D*D\e(B ?i table)
511 (set-case-syntax-pair ?I ?\e$(D)E\e(B table)))
513 (defun turkish-case-conversion-disable ()
514 "Set up normal
(non-Turkish) case conversion of
`i
' into
`I
'.
"
515 (let ((table (standard-case-table)))
516 (set-case-syntax-pair ?I ?i table)
517 (set-case-syntax ?\e$(D*D\e(B "w
" table)
518 (set-case-syntax ?\e$(D)E\e(B "w
" table)))
520 ;; Polish ISO 8859-2 environment.
521 ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
522 ;; Keywords: multilingual, Polish
524 (set-language-info-alist
525 "Polish
" '((charset iso-8859-2)
526 (coding-system iso-8859-2 windows-1250)
527 (coding-priority iso-8859-2)
528 (input-method . "polish-slash
")
529 (nonascii-translation . iso-8859-2)
530 (unibyte-display . iso-8859-2)
531 (tutorial . "TUTORIAL.pl
")
532 (sample-text . "P
\e$
(D+Q
\e(Bjd\e$
(D+u
\e(B, ki
\e$
(D+M
\e(B-\e$
(D+w
\e(Be t
\e$
(D+8\e(B chmurno
\e$
(D+\
++\e(B w g
\e$
(D)H
+(\e(Bb flaszy
")
536 (set-language-info-alist
537 "Welsh
" `((coding-system utf-8 latin-8) ; the input method is Unicode-based
538 (coding-priority utf-8 latin-8)
539 (nonascii-translation . iso-8859-14)
540 (input-method . "welsh
")
541 (documentation . "Support for Welsh
, using Unicode.
"))
544 (set-language-info-alist
545 "Latin-6
" `((coding-system latin-6)
546 (coding-priority latin-6)
547 (nonascii-translation . ,(get 'decode-iso-latin-6 'translation-table))
548 (input-method . "latin-prefix
")
549 (features code-pages)
550 (documentation . "Support for Latin-6.
"))
553 (set-language-info-alist
554 "Latin-7
" `((coding-system latin-7)
555 (coding-priority latin-7)
556 (nonascii-translation . iso-8859-13)
557 (input-method . "latin-prefix
")
558 (documentation . "Support for Latin-7
, e.g. Latvian
, Lithuanian.
"))
561 (set-language-info-alist
562 "Lithuanian
" `((coding-system latin-7 windows-1257)
563 (coding-priority latin-7)
564 (nonascii-translation . iso-8859-13)
565 (input-method . "lithuanian-keyboard
")
566 (documentation . "Support for Lithuanian.
"))
569 (set-language-info-alist
570 "Latvian
" `((coding-system latin-7 windows-1257)
571 (coding-priority latin-7)
572 (nonascii-translation . iso-8859-13)
573 (input-method . "latvian-keyboard
")
574 (documentation . "Support for Latvian.
"))
577 (set-language-info-alist
578 "Swedish
" '((tutorial . "TUTORIAL.sv
")
580 (coding-system iso-latin-1)
581 (coding-priority iso-latin-1)
582 (nonascii-translation . iso-8859-1)
583 (unibyte-display . iso-latin-1)
584 (sample-text . "Goddag Hej
")
585 (documentation . "Support for Swedish
"))
588 (set-language-info-alist
589 "Croatian
" '((charset iso-8859-2)
590 (coding-system iso-8859-2)
591 (coding-priority iso-8859-2)
592 (input-method . "croatian
")
593 (nonascii-translation . iso-8859-2)
594 (unibyte-display . iso-8859-2)
595 (documentation . "Support for Croatian with Latin-2 encoding.
"))
598 (set-language-info-alist
599 "Brazilian Portuguese
" '((tutorial . "TUTORIAL.pt_BR
")
601 (coding-system iso-latin-1 iso-latin-9)
602 (coding-priority iso-latin-1)
603 (nonascii-translation . iso-8859-1)
604 (unibyte-display . iso-8859-1)
605 (input-method . "latin-1-prefix
")
607 (documentation . "Support for Brazilian Portuguese.
"))
611 (define-coding-system 'mac-roman
612 "Mac Roman Encoding
(MIME:MACINTOSH
).
"
613 :coding-type 'charset
615 :charset-list '(mac-roman)
616 :mime-charset 'macintosh)
618 (define-coding-system 'next
620 :coding-type 'charset
622 :charset-list '(next)
625 (define-coding-system 'hp-roman8
626 "Hewlet-Packard roman-8 encoding
(MIME:ROMAN-8
)"
627 :coding-type 'charset
629 :charset-list '(hp-roman8)
630 :mime-charset 'hp-roman8)
631 (define-coding-system-alias 'roman8 'hp-roman8)
633 (define-coding-system 'adobe-standard-encoding
634 "Adobe
`standard
' encoding for PostScript
"
635 :coding-type 'charset
637 :charset-list '(adobe-standard-encoding)
638 :mime-charset 'adobe-standard-encoding)
641 ;; For automatic composing of diacritics and combining marks.
642 (dolist (range '( ;; combining diacritical marks
643 (#x0300 #x0314 (tc . bc))
645 (#x0316 #x0319 (bc . tc))
647 (#x031B #x0320 (bc . tc))
650 (#x0323 #x0333 (bc . tc))
651 (#x0334 #x0338 (Bc . Bc))
652 (#x0339 #x033C (bc . tc))
653 (#x033D #x033F (tc . bc))
656 (#x0342 #x0344 (tc . bc))
659 (#x0347 #x0349 (bc . tc))
660 (#x034A #x034C (tc . bc))
661 (#x034D #x034E (bc . tc))
662 ;; combining diacritical marks for symbols
663 (#x20D0 #x20D1 (tc . bc))
664 (#x20D2 #x20D3 (Bc . Bc))
665 (#x20D4 #x20D7 (tc . bc))
666 (#x20D8 #x20DA (Bc . Bc))
667 (#x20DB #x20DC (tc . bc))
668 (#x20DD #x20E0 (Bc . Bc))
670 (#x20E2 #x20E3 (Bc . Bc))))
671 (let* ((from (car range))
672 (to (if (= (length range) 3)
675 (composition (car (last range))))
677 (put-char-code-property from 'diacritic-composition composition)
678 (aset composition-function-table from 'diacritic-composition-function)
679 (setq from (1+ from)))))
681 (defconst diacritic-composition-pattern "\\C^
\\c^
+")
683 (defun diacritic-compose-region (beg end)
684 "Compose diacritic characters in the region.
685 When called from a program
, expects two arguments
,
686 positions
(integers or markers
) specifying the region.
"
689 (narrow-to-region beg end)
690 (goto-char (point-min))
691 (while (re-search-forward diacritic-composition-pattern nil t)
692 (if (= (char-syntax (char-after (match-beginning 0))) ?w)
693 (compose-region (match-beginning 0) (match-end 0))))))
695 (defun diacritic-compose-string (string)
696 "Compose diacritic characters in STRING and return the resulting string.
"
698 (while (setq idx (string-match diacritic-composition-pattern string idx))
699 (if (= (char-syntax (aref string idx)) ?w)
700 (compose-string string idx (match-end 0)))
701 (setq idx (match-end 0))))
704 (defun diacritic-compose-buffer ()
705 "Compose diacritic characters in the current buffer.
"
707 (diacritic-compose-region (point-min) (point-max)))
709 (defun diacritic-composition-function (pos to font-object string)
710 "Compose diacritic text around POS.
711 Optional
2nd argument STRING
, if non-nil
, is a string containing text
714 The return value is the end position of composed characters
,
715 or nil if no characters are composed.
"
719 (let ((ch (aref string pos))
720 start end components ch composition)
721 (when (= (char-syntax ch) ?w)
728 (setq ch (aref string pos)
730 (get-char-code-property ch
731 'diacritic-composition)))
732 (setq components (cons ch (cons composition components))
734 (compose-string string start pos (nreverse components))
736 (if (>= pos (point-min))
737 (let ((ch (char-after pos))
738 start end components composition)
739 (when (= (char-syntax ch) ?w)
746 (setq ch (char-after pos)
748 (get-char-code-property ch 'diacritic-composition)))
749 (setq components (cons ch (cons composition components))
751 (compose-region start pos (nreverse components))
756 ;; arch-tag: 9e018b12-fb02-4120-907b-9adeaf84b5c2
757 ;;; european.el ends here