]> code.delx.au - gnu-emacs/blob - lisp/language/european.el
(setup-8-bit-environment): Load the latin-N file again each time.
[gnu-emacs] / lisp / language / european.el
1 ;;; european.el --- Support for European languages
2
3 ;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
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 LANGAUGE which uses one-byte 8-bit CHARSET, one-byte
42 ;; 8-bit CODING-SYSTEM, and INPUT-METHOD.
43 (defun setup-8-bit-environment (language charset coding-system input-method)
44 (setup-english-environment)
45 (set-default-coding-systems coding-system)
46 (setq coding-category-iso-8-1 coding-system
47 coding-category-iso-8-2 coding-system)
48
49 (if charset
50 (let ((nonascii-offset (- (make-char charset) 128)))
51 ;; Set up for insertion of characters in this character set
52 ;; when codes 0200 - 0377 are typed in.
53 (setq nonascii-insert-offset nonascii-offset)))
54
55 (if input-method
56 (setq default-input-method input-method))
57
58 ;; If this is a Latin-N character set, set up syntax for it in
59 ;; single-byte mode. We can't use require because the file
60 ;; must be eval'd each time.
61 (if (string-match "^Latin-\\([1-9]\\)$" language)
62 (load (downcase language))))
63 \f
64 ;; Latin-1 (ISO-8859-1)
65
66 (make-coding-system
67 'iso-latin-1 2 ?1
68 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-1, Compound Text Encoding)"
69 '((ascii t) (latin-iso8859-1 t) nil nil
70 nil ascii-eol ascii-cntl nil nil nil nil nil nil nil nil nil t))
71
72 (define-coding-system-alias 'iso-8859-1 'iso-latin-1)
73 (define-coding-system-alias 'latin-1 'iso-latin-1)
74 (define-coding-system-alias 'ctext 'iso-latin-1)
75
76 (defun setup-latin1-environment ()
77 "Set up multilingual environment (MULE) for European Latin-1 users."
78 (interactive)
79 (setup-8-bit-environment "Latin-1" 'latin-iso8859-1 'iso-latin-1
80 "latin-1-prefix"))
81
82 (set-language-info-alist
83 "Latin-1" '((setup-function . (setup-latin1-environment
84 . setup-european-environment-map))
85 (charset . (ascii latin-iso8859-1))
86 (coding-system . (iso-latin-1))
87 (sample-text
88 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
89 (documentation . ("\
90 These languages are supported with the Latin-1 (ISO-8859-1) character set:
91 Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
92 Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
93 " . describe-european-environment-map))
94 ))
95 \f
96 ;; Latin-2 (ISO-8859-2)
97
98 (make-coding-system
99 'iso-latin-2 2 ?2
100 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
101 '((ascii t) (latin-iso8859-2 t) nil nil
102 nil ascii-eol ascii-cntl nil nil nil nil))
103
104 (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
105 (define-coding-system-alias 'latin-2 'iso-latin-2)
106
107 (defun setup-latin2-environment ()
108 "Set up multilingual environment (MULE) for European Latin-2 users."
109 (interactive)
110 (setup-8-bit-environment "Latin-2" 'latin-iso8859-2 'iso-latin-2
111 "latin-2-prefix"))
112
113 (set-language-info-alist
114 "Latin-2" '((setup-function . (setup-latin2-environment
115 . setup-european-environment-map))
116 (charset . (ascii latin-iso8859-2))
117 (coding-system . (iso-latin-2))
118 (documentation . ("\
119 These languages are supported with the Latin-2 (ISO-8859-2) character set:
120 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
121 Serbo-Croatian or Croatian, Slovak, Slovene, and Swedish.
122 " . describe-european-environment-map))
123 ))
124 \f
125 ;; Latin-3 (ISO-8859-3)
126
127 (make-coding-system
128 'iso-latin-3 2 ?3
129 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
130 '((ascii t) (latin-iso8859-3 t) nil nil
131 nil ascii-eol ascii-cntl nil nil nil nil))
132
133 (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
134 (define-coding-system-alias 'latin-3 'iso-latin-3)
135
136 (defun setup-latin3-environment ()
137 "Set up multilingual environment (MULE) for European Latin-3 users."
138 (interactive)
139 (setup-8-bit-environment "Latin-3" 'latin-iso8859-3 'iso-latin-3
140 "latin-3-prefix"))
141
142 (set-language-info-alist
143 "Latin-3" '((setup-function . (setup-latin3-environment
144 . setup-european-environment-map))
145 (charset . (ascii latin-iso8859-3))
146 (coding-system . (iso-latin-3))
147 (documentation . ("\
148 These languages are supported with the Latin-3 (ISO-8859-3) character set:
149 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
150 German, Italian, Maltese, Spanish, and Turkish.
151 " . describe-european-environment-map))
152 ))
153 \f
154 ;; Latin-4 (ISO-8859-4)
155
156 (make-coding-system
157 'iso-latin-4 2 ?4
158 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)"
159 '((ascii t) (latin-iso8859-4 t) nil nil
160 nil ascii-eol ascii-cntl nil nil nil nil))
161
162 (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
163 (define-coding-system-alias 'latin-4 'iso-latin-4)
164
165 (defun setup-latin4-environment ()
166 "Set up multilingual environment (MULE) for European Latin-4 users."
167 (interactive)
168 (setup-8-bit-environment "Latin-4" 'latin-iso8859-4 'iso-latin-4
169 "latin-4-prefix"))
170
171 (set-language-info-alist
172 "Latin-4" '((setup-function . (setup-latin4-environment
173 . setup-european-environment-map))
174 (charset . (ascii latin-iso8859-4))
175 (coding-system . (iso-8859-4))
176 (documentation . ("\
177 These languages are supported with the Latin-4 (ISO-8859-4) character set:
178 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
179 Latvian, Lithuanian, and Norwegian.
180 " . describe-european-environment-map))
181 ))
182 \f
183 ;; Latin-5 (ISO-8859-9)
184
185 (make-coding-system
186 'iso-latin-5 2 ?9
187 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
188 '((ascii t) (latin-iso8859-9 t) nil nil
189 nil ascii-eol ascii-cntl nil nil nil nil))
190
191 (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
192 (define-coding-system-alias 'latin-5 'iso-latin-5)
193
194 (defun setup-latin5-environment ()
195 "Set up multilingual environment (MULE) for European Latin-5 users."
196 (interactive)
197 (setup-8-bit-environment "Latin-5" 'latin-iso8859-9 'iso-latin-5
198 "latin-5-prefix"))
199
200 (set-language-info-alist
201 "Latin-5" '((setup-function . (setup-latin5-environment
202 . setup-european-environment-map))
203 (charset . (ascii latin-iso8859-9))
204 (coding-system . (iso-latin-5))
205 (documentation . ("\
206 These languages are supported with the Latin-5 (ISO-8859-9) character set.
207 " . describe-european-environment-map))
208 ))
209
210 ;;; european.el ends here