]> code.delx.au - gnu-emacs/blob - lisp/language/european.el
Most of setup-LANGUAGE-environment functions are
[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-support-map)
32 (define-key-after describe-language-support-map [European]
33 '("European" . describe-european-support-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)))
55 (setq nonascii-insert-offset nonascii-offset
56 set-case-syntax-offset nonascii-offset)))
57
58 (if input-method
59 (setq default-input-method input-method)))
60 \f
61 ;; Latin1 (ISO-8859-1)
62
63 (make-coding-system
64 'iso-8859-1 2 ?X
65 "MIME ISO-8859-1 Compound Text Encoding."
66 '((ascii t) (latin-iso8859-1 t) nil nil
67 nil ascii-eol ascii-cntl))
68
69 ;; CTEXT is an alias for ISO-8859-1
70 (define-coding-system-alias 'iso-8859-1 'ctext)
71
72 (register-input-method "Latin1"
73 '("quail-latin-1" quail-use-package "quail/latin"))
74
75 (defun setup-latin1-environment ()
76 "Setup multilingual environment (MULE) for European Latin1 users."
77 (interactive)
78 (setup-8-bit-environment 'latin-iso8859-1 'iso-8859-1
79 '("Latin1" . "quail-latin-1")))
80
81 (set-language-info-alist
82 "Latin1" '((setup-function . (setup-latin1-environment
83 . setup-european-environment-map))
84 (charset . (ascii latin-iso8859-1))
85 (coding-system . (iso-8859-1))
86 (sample-text
87 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
88 (documentation . ("\
89 The following languages is supported by Latin1 (ISO-8859-1) character set.
90 " . describe-european-support-map))
91 ))
92 \f
93 ;; Latin2 (ISO-8859-2)
94
95 (make-coding-system
96 'iso-8859-2 2 ?2 "MIME ISO-8859-2"
97 '((ascii t) (latin-iso8859-2 t) nil nil
98 nil ascii-eol ascii-cntl nil nil nil nil))
99
100 (register-input-method "Latin2"
101 '("quail-latin-2" quail-use-package "quail/latin"))
102
103 (defun setup-latin2-environment ()
104 "Setup multilingual environment (MULE) for European Latin2 users."
105 (interactive)
106 (setup-8-bit-environment 'latin-iso8859-2 'iso-8859-2
107 '("Latin2" . "quail-latin-2")))
108
109 (set-language-info-alist
110 "Latin2" '((setup-function . (setup-latin2-environment
111 . setup-european-environment-map))
112 (charset . (ascii latin-iso8859-2))
113 (coding-system . (iso-8859-2))
114 (documentation . ("\
115 The following languages is supported by Latin2 (ISO-8859-2) character set.
116 " . describe-european-support-map))
117 ))
118 \f
119 ;; Latin3 (ISO-8859-3)
120
121 (make-coding-system
122 'iso-8859-3 2 ?3 "MIME ISO-8859-3"
123 '((ascii t) (latin-iso8859-3 t) nil nil
124 nil ascii-eol ascii-cntl nil nil nil nil))
125
126 (register-input-method "Latin3"
127 '("quail-latin-3" quail-use-package "quail/latin"))
128
129 (defun setup-latin3-environment ()
130 "Setup multilingual environment (MULE) for European Latin3 users."
131 (interactive)
132 (setup-8-bit-environment 'latin-iso8859-3 'iso-8859-3
133 '("Latin3" . "quail-latin-3")))
134
135 (set-language-info-alist
136 "Latin3" '((setup-function . (setup-latin3-environment
137 . setup-european-environment-map))
138 (charset . (ascii latin-iso8859-3))
139 (coding-system . (iso-8859-3))
140 (documentation . ("\
141 The following languages is supported by Latin3 (ISO-8859-3) character set.
142 " . describe-european-support-map))
143 ))
144 \f
145 ;; Latin4 (ISO-8859-4)
146
147 (make-coding-system
148 'iso-8859-4 2 ?4 "MIME ISO-8859-4"
149 '((ascii t) (latin-iso8859-4 t) nil nil
150 nil ascii-eol ascii-cntl nil nil nil nil))
151
152 (register-input-method "European"
153 '("quail-latin-4" quail-use-package "quail/latin"))
154
155 (defun setup-latin4-environment ()
156 "Setup multilingual environment (MULE) for European Latin4 users."
157 (interactive)
158 (setup-8-bit-environment 'latin-iso8859-4 'iso-8859-4
159 '("Latin4" . "quail-latin-4")))
160
161 (set-language-info-alist
162 "Latin4" '((setup-function . (setup-latin4-environment
163 . setup-european-environment-map))
164 (charset . (ascii latin-iso8859-1))
165 (coding-system . (iso-8859-4))
166 (documentation . ("\
167 The following languages is supported by Latin4 (ISO-8859-4) character set.
168 " . describe-european-support-map))
169 ))
170 \f
171 ;; Latin4 (ISO-8859-9)
172
173 (make-coding-system
174 'iso-8859-9 2 ?9 "MIME ISO-8859-9"
175 '((ascii t) (latin-iso8859-9 t) nil nil
176 nil ascii-eol ascii-cntl nil nil nil nil))
177
178 (register-input-method "European"
179 '("quail-latin-5" quail-use-package "quail/latin"))
180
181 (defun setup-latin5-environment ()
182 "Setup multilingual environment (MULE) for European Latin5 users."
183 (interactive)
184 (setup-8-bit-environment 'latin-iso8859-9 'iso-8859-9
185 '("Latin5" . "quail-latin-5")))
186
187 (set-language-info-alist
188 "Latin5" '((setup-function . (setup-latin5-environment
189 . setup-european-environment-map))
190 (charset . (ascii latin-iso8859-9))
191 (coding-system . (iso-8859-9))
192 (documentation . ("\
193 The following languages is supported by Latin5 (ISO-8859-9) character set.
194 " . describe-european-support-map))
195 ))
196 \f
197 (let ((languages '("French" "German" "Spanish" "Italian"
198 ;; We have to list much more European languages here.
199 ))
200 (val '("quail-latin-1" quail-use-package "quail/latin")))
201 (while languages
202 (register-input-method (car languages) val)
203 (setq languages (cdr languages))))
204
205 ;;; european.el ends here