]> code.delx.au - gnu-emacs/blob - lisp/language/european.el
(setup-8-bit-environment): Do not
[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 (setq sendmail-coding-system coding-system
49 rmail-file-coding-system coding-system)
50
51 (if charset
52 (let ((nonascii-offset (- (make-char charset) 128)))
53 ;; Set up for insertion of characters in this character set
54 ;; when codes 0200 - 0377 are typed in.
55 (setq nonascii-insert-offset nonascii-offset)))
56
57 (if input-method
58 (progn
59 (setq default-input-method input-method)
60 (setq-default default-input-method input-method)))
61
62 ;; If this is a Latin-N character set, set up syntax for it in
63 ;; single-byte mode.
64 (if (string-match "^Latin-\\([1-9]\\)$" language)
65 (load (downcase language))))
66 \f
67 ;; Latin-1 (ISO-8859-1)
68
69 (make-coding-system
70 'iso-latin-1 2 ?1
71 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-1, Compound Text Encoding)"
72 '((ascii t) (latin-iso8859-1 t) nil nil
73 nil ascii-eol ascii-cntl))
74
75 (define-coding-system-alias 'iso-8859-1 'iso-latin-1)
76 (define-coding-system-alias 'latin-1 'iso-latin-1)
77 (define-coding-system-alias 'ctext 'iso-latin-1)
78
79 (defun setup-latin1-environment ()
80 "Set up multilingual environment (MULE) for European Latin-1 users."
81 (interactive)
82 (setup-8-bit-environment "Latin-1" 'latin-iso8859-1 'iso-latin-1
83 "latin-1-prefix"))
84
85 (set-language-info-alist
86 "Latin-1" '((setup-function . (setup-latin1-environment
87 . setup-european-environment-map))
88 (charset . (ascii latin-iso8859-1))
89 (coding-system . (iso-latin-1))
90 (sample-text
91 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
92 (documentation . ("\
93 These languages are supported with the Latin-1 (ISO-8859-1) character set:
94 Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
95 Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
96 " . describe-european-environment-map))
97 ))
98 \f
99 ;; Latin-2 (ISO-8859-2)
100
101 (make-coding-system
102 'iso-latin-2 2 ?2
103 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
104 '((ascii t) (latin-iso8859-2 t) nil nil
105 nil ascii-eol ascii-cntl nil nil nil nil))
106
107 (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
108 (define-coding-system-alias 'latin-2 'iso-latin-2)
109
110 (defun setup-latin2-environment ()
111 "Set up multilingual environment (MULE) for European Latin-2 users."
112 (interactive)
113 (setup-8-bit-environment "Latin-2" 'latin-iso8859-2 'iso-latin-2
114 "latin-2-prefix"))
115
116 (set-language-info-alist
117 "Latin-2" '((setup-function . (setup-latin2-environment
118 . setup-european-environment-map))
119 (charset . (ascii latin-iso8859-2))
120 (coding-system . (iso-latin-2))
121 (documentation . ("\
122 These languages are supported with the Latin-2 (ISO-8859-2) character set:
123 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
124 Serbo-Croatian or Croatian, Slovak, Slovene, and Swedish.
125 " . describe-european-environment-map))
126 ))
127 \f
128 ;; Latin-3 (ISO-8859-3)
129
130 (make-coding-system
131 'iso-latin-3 2 ?3
132 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
133 '((ascii t) (latin-iso8859-3 t) nil nil
134 nil ascii-eol ascii-cntl nil nil nil nil))
135
136 (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
137 (define-coding-system-alias 'latin-3 'iso-latin-3)
138
139 (defun setup-latin3-environment ()
140 "Set up multilingual environment (MULE) for European Latin-3 users."
141 (interactive)
142 (setup-8-bit-environment "Latin-3" 'latin-iso8859-3 'iso-latin-3
143 "latin-3-prefix"))
144
145 (set-language-info-alist
146 "Latin-3" '((setup-function . (setup-latin3-environment
147 . setup-european-environment-map))
148 (charset . (ascii latin-iso8859-3))
149 (coding-system . (iso-latin-3))
150 (documentation . ("\
151 These languages are supported with the Latin-3 (ISO-8859-3) character set:
152 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
153 German, Italian, Maltese, Spanish, and Turkish.
154 " . describe-european-environment-map))
155 ))
156 \f
157 ;; Latin-4 (ISO-8859-4)
158
159 (make-coding-system
160 'iso-latin-4 2 ?4
161 "ISO 2022 based 8-bit encoding (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 (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
166 (define-coding-system-alias 'latin-4 'iso-latin-4)
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-4" 'latin-iso8859-4 'iso-latin-4
172 "latin-4-prefix"))
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-latin-5 2 ?9
190 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
191 '((ascii t) (latin-iso8859-9 t) nil nil
192 nil ascii-eol ascii-cntl nil nil nil nil))
193
194 (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
195 (define-coding-system-alias 'latin-5 'iso-latin-5)
196
197 (defun setup-latin5-environment ()
198 "Set up multilingual environment (MULE) for European Latin-5 users."
199 (interactive)
200 (setup-8-bit-environment "Latin-5" 'latin-iso8859-9 'iso-latin-5
201 "latin-5-prefix"))
202
203 (set-language-info-alist
204 "Latin-5" '((setup-function . (setup-latin5-environment
205 . setup-european-environment-map))
206 (charset . (ascii latin-iso8859-9))
207 (coding-system . (iso-latin-5))
208 (documentation . ("\
209 These languages are supported with the Latin-5 (ISO-8859-9) character set.
210 " . describe-european-environment-map))
211 ))
212
213 ;;; european.el ends here