Initial git import
[sxemacs] / lisp / mule / european.el
1 ;;; european.el --- European languages -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
6
7 ;; Keywords: multilingual, European
8
9 ;; This file is part of SXEmacs.
10
11 ;; SXEmacs 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 3 of the License, or
14 ;; (at your option) any later version.
15
16 ;; SXEmacs 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 this program.  If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Commentary:
25
26 ;; For Europeans, six coded character sets ISO8859-1,2,3,4,9 are supported.
27 ;; Note: ISO 8859/15 (Latin-9) is supported via the latin-unity package.
28
29 ;; #### latin.el would be a better name for this file.
30
31 ;;; Code:
32
33 ;; For syntax of Latin-1 characters.
34 (loop for c from 64 to 127              ; from '\e,A@\e(B' to '\e,A\7f\e(B'
35       do (modify-syntax-entry (make-char 'latin-iso8859-1 c) "w"))
36
37 (modify-syntax-entry (make-char 'latin-iso8859-1 32) "w") ; no-break space
38 (modify-syntax-entry ?\e,AW\e(B "_")
39 (modify-syntax-entry ?\e,Aw\e(B "_")
40
41 ;; For syntax of Latin-2
42 (loop for c in '(?\e,B!\e(B ?\e,B#\e(B ?\e,B%\e(B ?\e,B&\e(B ?\e,B)\e(B ?\e,B*\e(B ?\e,B+\e(B ?\e,B,\e(B ?\e,B.\e(B ?\e,B/\e(B ?\e,B1\e(B ?\e,B3\e(B ?\e,B5\e(B ?\e,B6\e(B ?\e,B9\e(B ?\e,B:\e(B ?\e,B;\e(B ?\e,B<\e(B)
43       do (modify-syntax-entry c "w"))
44
45 (loop for c from 62 to 126
46       do (modify-syntax-entry (make-char 'latin-iso8859-2 c) "w"))
47
48 (modify-syntax-entry (make-char 'latin-iso8859-2 32) "w") ; no-break space
49 (modify-syntax-entry ?\e,BW\e(B ".")
50 (modify-syntax-entry ?\e,Bw\e(B ".")
51
52 ;; For syntax of Latin-3
53 (loop for c in '(?\e,C!\e(B ?\e,C&\e(B ?\e,C)\e(B ?\e,C*\e(B ?\e,C+\e(B ?\e,C,\e(B ?\e,C/\e(B ?\e,C1\e(B ?\e,C5\e(B ?\e,C6\e(B ?\e,C:\e(B ?\e,C;\e(B ?\e,C<\e(B ?\e,C?\e(B)
54   do (modify-syntax-entry c "w"))
55
56 (loop for c from 64 to 126
57   do (modify-syntax-entry (make-char 'latin-iso8859-3 c) "w"))
58
59 (modify-syntax-entry (make-char 'latin-iso8859-3 32) "w") ; no-break space
60 (modify-syntax-entry ?\e,CW\e(B ".")
61 (modify-syntax-entry ?\e,Cw\e(B ".")
62
63 ;; For syntax of Latin-4
64 (loop for c in '(?\e,D!\e(B ?\e,D"\e(B ?\e,D#\e(B ?\e,D%\e(B ?\e,D&\e(B ?\e,D)\e(B ?\e,D*\e(B ?\e,D+\e(B ?\e,D,\e(B ?\e,D.\e(B ?\e,D1\e(B ?\e,D3\e(B ?\e,D5\e(B ?\e,D6\e(B ?\e,D9\e(B ?\e,D:\e(B ?\e,D;\e(B ?\e,D<\e(B ?\e,D=\e(B ?\e,D>\e(B ?\e,D?\e(B)
65   do (modify-syntax-entry c "w"))
66
67 (loop for c from 64 to 126
68   do (modify-syntax-entry (make-char 'latin-iso8859-4 c) "w"))
69
70 (modify-syntax-entry (make-char 'latin-iso8859-4 32) "w") ; no-break space
71 (modify-syntax-entry ?\e,DW\e(B ".")
72 (modify-syntax-entry ?\e,Dw\e(B ".")
73
74
75 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
76 ;;; EUROPEANS
77 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
78
79 \f
80 ;; Latin-1 (ISO-8859-1)
81
82 ;; (make-coding-system
83 ;;  'iso-latin-1 2 ?1
84 ;;  "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)"
85 ;;  '(ascii latin-iso8859-1 nil nil
86 ;;    nil nil nil nil nil nil nil nil nil nil nil nil t)
87 ;;  '((safe-charsets ascii latin-iso8859-1)
88 ;;    (mime-charset . iso-8859-1)))
89
90 ;; (define-coding-system-alias 'iso-8859-1 'iso-latin-1)
91 ;; (define-coding-system-alias 'latin-1 'iso-latin-1)
92
93 ;; (make-coding-system
94 ;;  'compound-text 2 ?1
95 ;;  "ISO 2022 based encoding used in inter client communication of X"
96 ;;  '((ascii t) (latin-iso8859-1 t) nil nil
97 ;;    nil ascii-eol ascii-cntl nil nil nil nil nil nil nil nil nil t)
98 ;;  '((safe-charsets . t)))
99
100 ;; (define-coding-system-alias 'ctext 'compound-text)
101
102 (defun setup-latin1-environment ()
103   "Set up multilingual environment (MULE) for European Latin-1 users."
104   (interactive)
105   (set-language-environment "Latin-1"))
106
107 (set-language-info-alist
108  "Latin-1" '((charset ascii latin-iso8859-1)
109              (coding-system iso-8859-1)
110              (coding-priority iso-8859-1)
111              (input-method . "latin-1-prefix")
112              (sample-text
113               . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
114              (documentation . "This language environment is a generic one for Latin-1 (ISO-8859-1)
115 character set which supports the following languages:
116  Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
117  Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
118 We also have a German specific language environment \"German\"."))
119  '("European"))
120
121 (set-language-info-alist
122  "French" '((charset ascii latin-iso8859-1)
123             (coding-system iso-8859-1)
124             (coding-priority iso-8859-1)
125             (tutorial . "TUTORIAL.fr")
126             (sample-text
127              . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
128             (documentation . ("These languages are supported with the Latin-1 (ISO-8859-1) character set:
129  Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
130  Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
131 ")))
132  '("European"))
133
134 (set-language-info-alist
135  "Norwegian" '((charset ascii latin-iso8859-1)
136                (coding-system iso-8859-1)
137                (coding-priority iso-8859-1)
138                (tutorial . "TUTORIAL.no")
139                (sample-text
140                 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
141                (documentation . ("These languages are supported with the Latin-1 (ISO-8859-1) character set:
142  Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
143  Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
144 ")))
145  '("European"))
146
147 \f
148 ;; Latin-2 (ISO-8859-2)
149
150 ;; (make-coding-system
151 ;;  'iso-latin-2 2 ?2
152 ;;  "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
153 ;;  '(ascii latin-iso8859-2 nil nil
154 ;;    nil nil nil nil nil nil nil)
155 ;;  '((safe-charsets ascii latin-iso8859-2)
156 ;;    (mime-charset . iso-8859-2)))
157
158 ;; (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
159 ;; (define-coding-system-alias 'latin-2 'iso-latin-2)
160
161 (make-coding-system
162  'iso-8859-2 'iso2022 "MIME ISO-8859-2"
163  '(charset-g0 ascii
164    charset-g1 latin-iso8859-2
165    charset-g2 t
166    charset-g3 t
167    mnemonic "MIME/Ltn-2"
168    ))
169
170 (defun setup-latin2-environment ()
171   "Set up multilingual environment (MULE) for European Latin-2 users."
172   (interactive)
173   (set-language-environment "Latin-2"))
174
175 (set-language-info-alist
176  "Latin-2" '((charset ascii latin-iso8859-2)
177              (coding-system iso-8859-2)
178              (coding-priority iso-8859-2)
179              (input-method . "latin-2-prefix")
180              (documentation . "This language environment is a generic one for Latin-2 (ISO-8859-2)
181 character set which supports the following languages:
182  Albanian, Czech, English, German, Hungarian, Polish, Romanian,
183  Serbian, Croatian, Slovak, Slovene, Sorbian (upper and lower),
184  and Swedish."))
185  '("European"))
186
187 (set-language-info-alist
188  "Croatian" '((charset ascii latin-iso8859-2)
189               (coding-system iso-8859-2)
190               (coding-priority iso-8859-2)
191               (tutorial . "TUTORIAL.hr")
192               (documentation . "This language environment is a generic one for Latin-2 (ISO-8859-2)
193 character set which supports the following languages:
194  Albanian, Czech, English, German, Hungarian, Polish, Romanian,
195  Serbian, Croatian, Slovak, Slovene, Sorbian (upper and lower),
196  and Swedish."))
197  '("European"))
198
199 (set-language-info-alist
200  "Polish" '((charset ascii latin-iso8859-2)
201             (coding-system iso-8859-2)
202             (coding-priority iso-8859-2)
203             (tutorial . "TUTORIAL.pl")
204             (documentation . "This language environment is a generic one for Latin-2 (ISO-8859-2)
205 character set which supports the following languages:
206  Albanian, Czech, English, German, Hungarian, Polish, Romanian,
207  Serbian, Croatian, Slovak, Slovene, Sorbian (upper and lower),
208  and Swedish."))
209  '("European"))
210
211 ;; Romanian support originally from romanian.el
212
213 (defun setup-romanian-environment ()
214   "Setup multilingual environment (MULE) for Romanian."
215   (interactive)
216   (set-language-environment "Romanian"))
217
218 (set-language-info-alist
219  "Romanian" '((charset ascii latin-iso8859-2)
220               (coding-system iso-8859-2)
221               (coding-priority iso-8859-2)
222               (input-method . "latin-2-postfix")
223               (tutorial . "TUTORIAL.ro")
224               (sample-text . "Bun\e,Bc\e(B ziua, bine a\e,B~\e(Bi venit!")
225               (documentation . t))
226  '("European"))
227
228 (provide 'romanian)
229
230 ;; Czech support originally from czech.el
231 ;; Author: Milan Zamazal <pdm@fi.muni.cz>
232 ;; Maintainer(for XEmacs): David Sauer <davids@penguin.cz>
233
234 (defun setup-czech-environment ()
235   "Set up multilingual environment (MULE) for czech users."
236   (interactive)
237   (set-language-environment "Czech"))
238
239 (set-language-info-alist
240  "Czech" '((charset ascii latin-iso8859-2)
241            (coding-system iso-8859-2)
242            (coding-priority iso-8859-2)
243            (tutorial . "TUTORIAL.cs")
244            (sample-text . "P\e,Bx\e(Bejeme v\e,Ba\e(Bm hezk\e,B}\e(B den!")
245            (documentation . t))
246  '("European"))
247
248 (provide 'czech)
249
250 \f
251 ;; Latin-3 (ISO-8859-3)
252
253 ;; (make-coding-system
254 ;;  'iso-latin-3 2 ?3
255 ;;  "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
256 ;;  '(ascii latin-iso8859-3 nil nil
257 ;;    nil nil nil nil nil nil nil)
258 ;;  '((safe-charsets ascii latin-iso8859-3)
259 ;;    (mime-charset . iso-8859-3)))
260
261 ;; (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
262 ;; (define-coding-system-alias 'latin-3 'iso-latin-3)
263
264 (make-coding-system
265  'iso-8859-3 'iso2022 "MIME ISO-8859-3"
266  '(charset-g0 ascii
267    charset-g1 latin-iso8859-3
268    charset-g2 t
269    charset-g3 t
270    mnemonic "MIME/Ltn-3"
271    ))
272
273 (defun setup-latin3-environment ()
274   "Set up multilingual environment (MULE) for European Latin-3 users."
275   (interactive)
276   (set-language-environment "Latin-3"))
277
278 (set-language-info-alist
279  "Latin-3" '((charset ascii latin-iso8859-3)
280              (coding-system iso-8859-3)
281              (coding-priority iso-8859-3)
282              (input-method . "latin-3-prefix")
283              (documentation . "These languages are supported with the Latin-3 (ISO-8859-3) character set:
284  Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
285  German, Italian, Maltese, Spanish, and Turkish."))
286  '("European"))
287
288 \f
289 ;; Latin-4 (ISO-8859-4)
290
291 ;; (make-coding-system
292 ;;  'iso-latin-4 2 ?4
293 ;;  "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)"
294 ;;  '(ascii latin-iso8859-4 nil nil
295 ;;    nil nil nil nil nil nil nil)
296 ;;  '((safe-charsets ascii latin-iso8859-4)
297 ;;    (mime-charset . iso-8895-4)))
298
299 ;; (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
300 ;; (define-coding-system-alias 'latin-4 'iso-latin-4)
301
302 (make-coding-system
303  'iso-8859-4 'iso2022 "MIME ISO-8859-4"
304  '(charset-g0 ascii
305    charset-g1 latin-iso8859-4
306    charset-g2 t
307    charset-g3 t
308    mnemonic "MIME/Ltn-4"
309    ))
310
311 (defun setup-latin4-environment ()
312   "Set up multilingual environment (MULE) for European Latin-4 users."
313   (interactive)
314   (set-language-environment "Latin-4"))
315
316 (set-language-info-alist
317  "Latin-4" '((charset ascii latin-iso8859-4)
318              (coding-system iso-8859-4)
319              (coding-priority iso-8859-4)
320              (input-method . "latin-4-prefix")
321              (documentation . "These languages are supported with the Latin-4 (ISO-8859-4) character set:
322  Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
323  Latvian, Lithuanian, and Norwegian."))
324  '("European"))
325
326 \f
327 ;; Latin-5 (ISO-8859-9)
328
329 ;; (make-coding-system
330 ;;  'iso-latin-5 2 ?9
331 ;;  "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
332 ;;  '(ascii latin-iso8859-9 nil nil
333 ;;    nil nil nil nil nil nil nil)
334 ;;  '((safe-charsets ascii latin-iso8859-9)
335 ;;    (mime-charset . iso-8859-9)))
336
337 ;; (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
338 ;; (define-coding-system-alias 'latin-5 'iso-latin-5)
339
340 (make-coding-system
341  'iso-8859-9 'iso2022 "MIME ISO-8859-9"
342  '(charset-g0 ascii
343    charset-g1 latin-iso8859-9
344    charset-g2 t
345    charset-g3 t
346    mnemonic "MIME/Ltn-5"
347    ))
348
349 (defun setup-latin5-environment ()
350   "Set up multilingual environment (MULE) for European Latin-5 users."
351   (interactive)
352   (set-language-environment "Latin-5"))
353
354 (set-language-info-alist
355  "Latin-5" '((charset ascii latin-iso8859-9)
356              (coding-system iso-8859-9)
357              (coding-priority iso-8859-9)
358              (input-method . "latin-5-prefix")
359              (documentation . "These languages are supported with the Latin-5 (ISO-8859-9) character set."))
360  '("European"))
361
362 \f
363 (defun setup-german-environment ()
364   "Set up multilingual environment (MULE) for German users."
365   (interactive)
366   (set-language-environment "German"))
367
368 (set-language-info-alist
369  "German" '((tutorial . "TUTORIAL.de")
370             (charset ascii latin-iso8859-1)
371             (coding-system iso-8859-1)
372             (coding-priority iso-8859-1)
373             (input-method . "german-postfix")
374             (sample-text . "German (Deutsch Nord)       Guten Tag
375 German (Deutsch S\e,A|\e(Bd)      Gr\e,A|_\e(B Gott")
376             (documentation . "This language environment is almost the same as Latin-1,
377 but default input method is set to \"german-postfix\"."))
378  '("European"))
379
380 (defun setup-slovenian-environment ()
381   "Setup multilingual environment (MULE) for Slovenian."
382   (interactive)
383   (set-language-environment "Slovenian"))
384
385 (set-language-info-alist
386  "Slovenian" '((charset . (ascii latin-iso8859-2))
387                (coding-system . (iso-8859-2))
388                (coding-priority . (iso-8859-2))
389                (input-method . "latin-2-postfix")
390                (tutorial . "TUTORIAL.sl")
391                (sample-text . "\e,B.\e(Belimo vam uspe\e,B9\e(Ben dan!")
392                (documentation . t))
393  '("European"))
394
395 (provide 'slovenian)
396
397 ;;; european.el ends here