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