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