159
|
1 ;;; european.el --- Support for European languages
|
|
2
|
|
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
|
197
|
4 ;; Licensed to the Free Software Foundation.
|
159
|
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 ;;; Code:
|
|
31
|
|
32 ;; For syntax of Latin-1 characters.
|
197
|
33 (loop for c from 64 to 127 ; from ',A@(B' to ',A(B'
|
159
|
34 do (modify-syntax-entry (make-char 'latin-iso8859-1 c) "w"))
|
|
35
|
|
36 (modify-syntax-entry (make-char 'latin-iso8859-1 32) "w") ; no-break space
|
197
|
37 (modify-syntax-entry ?,AW(B "_")
|
|
38 (modify-syntax-entry ?,Aw(B "_")
|
159
|
39
|
|
40 ;; For syntax of Latin-2
|
197
|
41 (loop for c in '(?,B!(B ?,B#(B ?,B%(B ?,B&(B ?,B)(B ?,B*(B ?,B+(B ?,B,(B ?,B.(B ?,B/(B ?,B1(B ?,B3(B ?,B5(B ?,B6(B ?,B9(B ?,B:(B ?,B;(B ?,B<(B)
|
159
|
42 do (modify-syntax-entry c "w"))
|
|
43
|
|
44 (loop for c from 62 to 126
|
|
45 do (modify-syntax-entry (make-char 'latin-iso8859-2 c) "w"))
|
|
46
|
|
47 (modify-syntax-entry (make-char 'latin-iso8859-2 32) "w") ; no-break space
|
197
|
48 (modify-syntax-entry ?,BW(B ".")
|
|
49 (modify-syntax-entry ?,Bw(B ".")
|
159
|
50
|
|
51 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
52 ;;; EUROPEANS
|
|
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
54
|
197
|
55 ;; (define-prefix-command 'describe-european-environment-map)
|
|
56 ;; (define-key-after describe-language-environment-map [European]
|
|
57 ;; '("European" . describe-european-environment-map)
|
|
58 ;; t)
|
|
59
|
|
60 ;; (define-prefix-command 'setup-european-environment-map)
|
|
61 ;; (define-key-after setup-language-environment-map [European]
|
|
62 ;; '("European" . setup-european-environment-map)
|
|
63 ;; t)
|
|
64
|
|
65 ;; Setup for LANGAUGE which uses one-byte 8-bit CHARSET, one-byte
|
|
66 ;; 8-bit CODING-SYSTEM, and INPUT-METHOD.
|
|
67 (defun setup-8-bit-environment (language charset coding-system input-method)
|
|
68 (setup-english-environment)
|
|
69 (set-default-coding-systems coding-system)
|
|
70 (setq coding-category-iso-8-1 coding-system
|
|
71 coding-category-iso-8-2 coding-system)
|
|
72
|
|
73 (if charset
|
|
74 (let ((nonascii-offset (- (make-char charset) 128)))
|
|
75 ;; Set up for insertion of characters in this character set
|
|
76 ;; when codes 0200 - 0377 are typed in.
|
|
77 (setq nonascii-insert-offset nonascii-offset)))
|
|
78
|
|
79 (if input-method
|
|
80 (setq default-input-method input-method))
|
|
81
|
|
82 ;; If this is a Latin-N character set, set up syntax for it in
|
|
83 ;; single-byte mode. We can't use require because the file
|
|
84 ;; must be eval'd each time in case we change from one Latin-N to another.
|
|
85 (if (string-match "^Latin-\\([1-9]\\)$" language)
|
|
86 (load (downcase language) nil t)))
|
|
87
|
|
88 ;; (define-language-environment 'european
|
|
89 ;; "European (for Latin-1 through Latin-5)"
|
|
90 ;; (lambda ()
|
|
91 ;; (set-coding-category-system 'iso-8-designate 'iso-8859-1)
|
|
92 ;; (set-coding-priority-list '(iso-8-designate iso-8-1))
|
|
93 ;; ;;(setq locale-coding-system 'no-conversion) ; iso-8859-1
|
|
94 ;; (set-default-buffer-file-coding-system 'no-conversion) ; iso-8859-1
|
|
95 ;; ;;(set-buffer-file-coding-system-for-read 'no-conversion) ; iso-8859-1
|
|
96 ;; ;;(setq display-coding-system 'iso-8859-1)
|
|
97 ;; ;;(setq keyboard-coding-system 'iso-8859-1)
|
|
98 ;; ;; (setq-default quail-current-package
|
|
99 ;; ;; (assoc "latin-1" quail-package-alist))
|
|
100 ;; ))
|
159
|
101
|
197
|
102 ;; Latin-1 (ISO-8859-1)
|
159
|
103
|
|
104 ;; (make-coding-system
|
197
|
105 ;; 'iso-latin-1 2 ?1
|
|
106 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-1, Compound Text Encoding)"
|
|
107 ;; '((ascii t) (latin-iso8859-1 t) nil nil
|
|
108 ;; nil ascii-eol ascii-cntl nil nil nil nil nil nil nil nil nil t))
|
|
109
|
|
110 ;; (define-coding-system-alias 'iso-8859-1 'iso-latin-1)
|
|
111 ;; (define-coding-system-alias 'latin-1 'iso-latin-1)
|
|
112 ;; (define-coding-system-alias 'ctext 'iso-latin-1)
|
|
113
|
|
114 (defun setup-latin1-environment ()
|
|
115 "Set up multilingual environment (MULE) for European Latin-1 users."
|
|
116 (interactive)
|
|
117 (setup-8-bit-environment "Latin-1" 'latin-iso8859-1 'iso-8859-1
|
|
118 "latin-1-prefix"))
|
|
119
|
|
120 (set-language-info-alist
|
|
121 "Latin-1" '((setup-function . (setup-latin1-environment
|
|
122 . setup-european-environment-map))
|
|
123 (charset . (ascii latin-iso8859-1))
|
|
124 (coding-system . (iso-8859-1))
|
|
125 (sample-text
|
|
126 . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!")
|
|
127 (documentation . ("\
|
|
128 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 " . describe-european-environment-map))
|
|
132 ))
|
|
133
|
|
134 ;; Latin-2 (ISO-8859-2)
|
|
135
|
|
136 ;; (make-coding-system
|
|
137 ;; 'iso-latin-2 2 ?2
|
|
138 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
|
159
|
139 ;; '((ascii t) (latin-iso8859-2 t) nil nil
|
|
140 ;; nil ascii-eol ascii-cntl nil nil nil nil))
|
|
141
|
197
|
142 ;; (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
|
|
143 ;; (define-coding-system-alias 'latin-2 'iso-latin-2)
|
|
144
|
159
|
145 (make-coding-system
|
|
146 'iso-8859-2 'iso2022 "MIME ISO-8859-2"
|
|
147 '(charset-g0 ascii
|
|
148 charset-g1 latin-iso8859-2
|
|
149 charset-g2 t
|
|
150 charset-g3 t
|
|
151 mnemonic "MIME/Ltn-2"
|
|
152 ))
|
|
153
|
197
|
154 (defun setup-latin2-environment ()
|
|
155 "Set up multilingual environment (MULE) for European Latin-2 users."
|
|
156 (interactive)
|
|
157 (setup-8-bit-environment "Latin-2" 'latin-iso8859-2 'iso-8859-2
|
|
158 "latin-2-prefix"))
|
|
159
|
|
160 (set-language-info-alist
|
|
161 "Latin-2" '((setup-function . (setup-latin2-environment
|
|
162 . setup-european-environment-map))
|
|
163 (charset . (ascii latin-iso8859-2))
|
|
164 (coding-system . (iso-8859-2))
|
|
165 (documentation . ("\
|
|
166 These languages are supported with the Latin-2 (ISO-8859-2) character set:
|
|
167 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
|
|
168 Serbo-Croatian or Croatian, Slovak, Slovene, and Swedish.
|
|
169 " . describe-european-environment-map))
|
|
170 ))
|
|
171
|
|
172 ;; Latin-3 (ISO-8859-3)
|
|
173
|
159
|
174 ;; (make-coding-system
|
197
|
175 ;; 'iso-latin-3 2 ?3
|
|
176 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
|
159
|
177 ;; '((ascii t) (latin-iso8859-3 t) nil nil
|
|
178 ;; nil ascii-eol ascii-cntl nil nil nil nil))
|
|
179
|
197
|
180 ;; (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
|
|
181 ;; (define-coding-system-alias 'latin-3 'iso-latin-3)
|
|
182
|
159
|
183 (make-coding-system
|
|
184 'iso-8859-3 'iso2022 "MIME ISO-8859-3"
|
|
185 '(charset-g0 ascii
|
|
186 charset-g1 latin-iso8859-3
|
|
187 charset-g2 t
|
|
188 charset-g3 t
|
|
189 mnemonic "MIME/Ltn-3"
|
|
190 ))
|
|
191
|
197
|
192 (defun setup-latin3-environment ()
|
|
193 "Set up multilingual environment (MULE) for European Latin-3 users."
|
|
194 (interactive)
|
|
195 (setup-8-bit-environment "Latin-3" 'latin-iso8859-3 'iso-8859-3
|
|
196 "latin-3-prefix"))
|
|
197
|
|
198 (set-language-info-alist
|
|
199 "Latin-3" '((setup-function . (setup-latin3-environment
|
|
200 . setup-european-environment-map))
|
|
201 (charset . (ascii latin-iso8859-3))
|
|
202 (coding-system . (iso-8859-3))
|
|
203 (documentation . ("\
|
|
204 These languages are supported with the Latin-3 (ISO-8859-3) character set:
|
|
205 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
|
|
206 German, Italian, Maltese, Spanish, and Turkish.
|
|
207 " . describe-european-environment-map))
|
|
208 ))
|
|
209
|
|
210 ;; Latin-4 (ISO-8859-4)
|
|
211
|
159
|
212 ;; (make-coding-system
|
197
|
213 ;; 'iso-latin-4 2 ?4
|
|
214 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)"
|
159
|
215 ;; '((ascii t) (latin-iso8859-4 t) nil nil
|
|
216 ;; nil ascii-eol ascii-cntl nil nil nil nil))
|
|
217
|
197
|
218 ;; (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
|
|
219 ;; (define-coding-system-alias 'latin-4 'iso-latin-4)
|
|
220
|
159
|
221 (make-coding-system
|
|
222 'iso-8859-4 'iso2022 "MIME ISO-8859-4"
|
|
223 '(charset-g0 ascii
|
|
224 charset-g1 latin-iso8859-4
|
|
225 charset-g2 t
|
|
226 charset-g3 t
|
|
227 mnemonic "MIME/Ltn-4"
|
|
228 ))
|
|
229
|
197
|
230 (defun setup-latin4-environment ()
|
|
231 "Set up multilingual environment (MULE) for European Latin-4 users."
|
|
232 (interactive)
|
|
233 (setup-8-bit-environment "Latin-4" 'latin-iso8859-4 'iso-8859-4
|
|
234 "latin-4-prefix"))
|
|
235
|
|
236 (set-language-info-alist
|
|
237 "Latin-4" '((setup-function . (setup-latin4-environment
|
|
238 . setup-european-environment-map))
|
|
239 (charset . (ascii latin-iso8859-4))
|
|
240 (coding-system . (iso-8859-4))
|
|
241 (documentation . ("\
|
|
242 These languages are supported with the Latin-4 (ISO-8859-4) character set:
|
|
243 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
|
|
244 Latvian, Lithuanian, and Norwegian.
|
|
245 " . describe-european-environment-map))
|
|
246 ))
|
|
247
|
|
248 ;; Latin-5 (ISO-8859-9)
|
|
249
|
159
|
250 ;; (make-coding-system
|
197
|
251 ;; 'iso-latin-5 2 ?9
|
|
252 ;; "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
|
159
|
253 ;; '((ascii t) (latin-iso8859-9 t) nil nil
|
|
254 ;; nil ascii-eol ascii-cntl nil nil nil nil))
|
|
255
|
197
|
256 ;; (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
|
|
257 ;; (define-coding-system-alias 'latin-5 'iso-latin-5)
|
|
258
|
159
|
259 (make-coding-system
|
|
260 'iso-8859-9 'iso2022 "MIME ISO-8859-9"
|
|
261 '(charset-g0 ascii
|
|
262 charset-g1 latin-iso8859-9
|
|
263 charset-g2 t
|
|
264 charset-g3 t
|
|
265 mnemonic "MIME/Ltn-5"
|
|
266 ))
|
|
267
|
197
|
268 (defun setup-latin5-environment ()
|
|
269 "Set up multilingual environment (MULE) for European Latin-5 users."
|
159
|
270 (interactive)
|
197
|
271 (setup-8-bit-environment "Latin-5" 'latin-iso8859-9 'iso-8859-5
|
|
272 "latin-5-prefix"))
|
159
|
273
|
|
274 (set-language-info-alist
|
197
|
275 "Latin-5" '((setup-function . (setup-latin5-environment
|
|
276 . setup-european-environment-map))
|
|
277 (charset . (ascii latin-iso8859-9))
|
|
278 (coding-system . (iso-8859-5))
|
|
279 (documentation . ("\
|
|
280 These languages are supported with the Latin-5 (ISO-8859-9) character set.
|
|
281 " . describe-european-environment-map))
|
|
282 ))
|
159
|
283
|
197
|
284 ;; (defun setup-european-environment ()
|
|
285 ;; "Setup multilingual environment (MULE) for European languages users.
|
|
286 ;; It actually reset MULE to the default status, and
|
|
287 ;; set quail-latin-1 as the default input method to be selected.
|
|
288 ;; See also the documentation of setup-english-environment."
|
|
289 ;; (setup-english-environment)
|
|
290 ;; (setq default-input-method '("European" . "quail-latin-1")))
|
171
|
291
|
197
|
292 ;; (defun describe-european-support ()
|
|
293 ;; "Describe how Emacs support European languages."
|
|
294 ;; (interactive)
|
|
295 ;; (describe-language-support-internal "European"))
|
171
|
296
|
197
|
297 ;; (set-language-info-alist
|
|
298 ;; "European" '((setup-function . setup-european-environment)
|
|
299 ;; (describe-function . describe-european-support)
|
|
300 ;; (charset . (ascii latin-iso8859-1 latin-iso8859-2
|
|
301 ;; latin-iso8859-3 latin-iso8859-4 latin-iso8859-9))
|
|
302 ;; (coding-system . (iso-8859-1 iso-8859-2 iso-8859-3
|
|
303 ;; iso-8859-4 iso-8859-9))
|
|
304 ;; (sample-text
|
|
305 ;; . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!")
|
|
306 ;; (documentation . "\
|
|
307 ;; Almost all of European languages are supported by the character sets and
|
|
308 ;; coding systems listed below.
|
|
309 ;; To input them, LEIM (Libraries for Emacs Input Methods) should have been
|
|
310 ;; installed.")
|
|
311 ;; ))
|
171
|
312
|
159
|
313 ;;; european.el ends here
|