]> code.delx.au - gnu-emacs/blob - lisp/language/european.el
(describe-european-environment-map):
[gnu-emacs] / lisp / language / european.el
1 ;;; european.el --- Support for European languages
2
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
5
6 ;; Keywords: multilingual, European
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;; For Europeans, five character sets ISO8859-1,2,3,4,9 are supported.
28
29 ;;; Code:
30
31 (define-prefix-command 'describe-european-environment-map)
32 (define-key-after describe-language-environment-map [European]
33 '("European" . describe-european-environment-map)
34 t)
35
36 (define-prefix-command 'setup-european-environment-map)
37 (define-key-after setup-language-environment-map [European]
38 '("European" . setup-european-environment-map)
39 t)
40
41 ;; Setup for a langauge which uses one-byte 8-bit CHARSET, one-byte
42 ;; 8-bit CODING-SYSTEM, and INPUT-METHOD.
43 (defun setup-8-bit-environment (charset coding-system input-method)
44 (setup-english-environment)
45 (setq-default buffer-file-coding-system coding-system)
46 (setq coding-category-iso-8-1 coding-system
47 coding-category-iso-8-2 coding-system)
48 (set-terminal-coding-system-internal coding-system)
49 (set-keyboard-coding-system-internal coding-system)
50 (setq sendmail-coding-system nil
51 rmail-file-coding-system coding-system)
52
53 (if charset
54 (let ((nonascii-offset (- (make-char charset) 128)))
55 ;; Set up for insertion of characters in this character set
56 ;; when codes 0200 - 0377 are typed in.
57 (setq nonascii-insert-offset nonascii-offset)))
58
59 (if input-method
60 (let ((latin-name (car input-method)))
61 (setq default-input-method input-method)
62 ;; If this is a Latin-N character set, set up syntax for it
63 ;; in single-byte mode.
64 (when (and latin-name
65 (string-match "^Latin-\\([1-9]\\)$" latin-name))
66 (require (intern (downcase latin-name)))))))
67 \f
68 ;; Latin-1 (ISO-8859-1)
69
70 (make-coding-system
71 'iso-8859-1 2 ?1
72 "MIME ISO-8859-1 Compound Text Encoding."
73 '((ascii t) (latin-iso8859-1 t) nil nil
74 nil ascii-eol ascii-cntl))
75
76 ;; CTEXT is an alias for ISO-8859-1
77 (define-coding-system-alias 'iso-8859-1 'ctext)
78
79 (register-input-method "Latin-1"
80 '("quail-latin-1" quail-use-package "quail/latin"))
81
82 (defun setup-latin1-environment ()
83 "Set up multilingual environment (MULE) for European Latin-1 users."
84 (interactive)
85 (setup-8-bit-environment 'latin-iso8859-1 'iso-8859-1
86 '("Latin-1" . "quail-latin-1")))
87
88 (set-language-info-alist
89 "Latin-1" '((setup-function . (setup-latin1-environment
90 . setup-european-environment-map))
91 (charset . (ascii latin-iso8859-1))
92 (coding-system . (iso-8859-1))
93 (sample-text
94 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
95 (documentation . ("\
96 These languages are supported with the Latin-1 (ISO-8859-1) character set:
97 Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
98 Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
99 " . describe-european-environment-map))
100 ))
101 \f
102 ;; Latin-2 (ISO-8859-2)
103
104 (make-coding-system
105 'iso-8859-2 2 ?2 "MIME ISO-8859-2"
106 '((ascii t) (latin-iso8859-2 t) nil nil
107 nil ascii-eol ascii-cntl nil nil nil nil))
108
109 (register-input-method "Latin-2"
110 '("quail-latin-2" quail-use-package "quail/latin"))
111
112 (defun setup-latin2-environment ()
113 "Set up multilingual environment (MULE) for European Latin-2 users."
114 (interactive)
115 (setup-8-bit-environment 'latin-iso8859-2 'iso-8859-2
116 '("Latin-2" . "quail-latin-2")))
117
118 (set-language-info-alist
119 "Latin-2" '((setup-function . (setup-latin2-environment
120 . setup-european-environment-map))
121 (charset . (ascii latin-iso8859-2))
122 (coding-system . (iso-8859-2))
123 (documentation . ("\
124 These languages are supported with the Latin-2 (ISO-8859-2) character set:
125 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
126 Serbo-Croatian, Slovak, Slovene, and Swedish.
127 " . describe-european-environment-map))
128 ))
129 \f
130 ;; Latin-3 (ISO-8859-3)
131
132 (make-coding-system
133 'iso-8859-3 2 ?3 "MIME ISO-8859-3"
134 '((ascii t) (latin-iso8859-3 t) nil nil
135 nil ascii-eol ascii-cntl nil nil nil nil))
136
137 (register-input-method "Latin-3"
138 '("quail-latin-3" quail-use-package "quail/latin"))
139
140 (defun setup-latin3-environment ()
141 "Set up multilingual environment (MULE) for European Latin-3 users."
142 (interactive)
143 (setup-8-bit-environment 'latin-iso8859-3 'iso-8859-3
144 '("Latin-3" . "quail-latin-3")))
145
146 (set-language-info-alist
147 "Latin-3" '((setup-function . (setup-latin3-environment
148 . setup-european-environment-map))
149 (charset . (ascii latin-iso8859-3))
150 (coding-system . (iso-8859-3))
151 (documentation . ("\
152 These languages are supported with the Latin-3 (ISO-8859-3) character set:
153 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
154 German, Italian, Maltese, Spanish, and Turkish.
155 " . describe-european-environment-map))
156 ))
157 \f
158 ;; Latin-4 (ISO-8859-4)
159
160 (make-coding-system
161 'iso-8859-4 2 ?4 "MIME ISO-8859-4"
162 '((ascii t) (latin-iso8859-4 t) nil nil
163 nil ascii-eol ascii-cntl nil nil nil nil))
164
165 (register-input-method "Latin-4"
166 '("quail-latin-4" quail-use-package "quail/latin"))
167
168 (defun setup-latin4-environment ()
169 "Set up multilingual environment (MULE) for European Latin-4 users."
170 (interactive)
171 (setup-8-bit-environment 'latin-iso8859-4 'iso-8859-4
172 '("Latin-4" . "quail-latin-4")))
173
174 (set-language-info-alist
175 "Latin-4" '((setup-function . (setup-latin4-environment
176 . setup-european-environment-map))
177 (charset . (ascii latin-iso8859-4))
178 (coding-system . (iso-8859-4))
179 (documentation . ("\
180 These languages are supported with the Latin-4 (ISO-8859-4) character set:
181 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
182 Latvian, Lithuanian, and Norwegian.
183 " . describe-european-environment-map))
184 ))
185 \f
186 ;; Latin-5 (ISO-8859-9)
187
188 (make-coding-system
189 'iso-8859-9 2 ?9 "MIME ISO-8859-9"
190 '((ascii t) (latin-iso8859-9 t) nil nil
191 nil ascii-eol ascii-cntl nil nil nil nil))
192
193 (register-input-method "Latin-5"
194 '("quail-latin-5" quail-use-package "quail/latin"))
195
196 (defun setup-latin5-environment ()
197 "Set up multilingual environment (MULE) for European Latin-5 users."
198 (interactive)
199 (setup-8-bit-environment 'latin-iso8859-9 'iso-8859-9
200 '("Latin-5" . "quail-latin-5")))
201
202 (set-language-info-alist
203 "Latin-5" '((setup-function . (setup-latin5-environment
204 . setup-european-environment-map))
205 (charset . (ascii latin-iso8859-9))
206 (coding-system . (iso-8859-9))
207 (documentation . ("\
208 These languages are supported with the Latin-5 (ISO-8859-9) character set.
209 " . describe-european-environment-map))
210 ))
211 \f
212 (let ((languages '("French" "German" "Spanish" "Italian"
213 ;; We have to list much more European languages here.
214 ))
215 (val '("quail-latin-1" quail-use-package "quail/latin")))
216 (while languages
217 (register-input-method (car languages) val)
218 (setq languages (cdr languages))))
219
220 ;;; european.el ends here