(memory_full): Pass Qnil to Fsignal for ERROR_SYMBOL.
[bpt/emacs.git] / lisp / language / european.el
CommitLineData
4ed46869
KH
1;;; european.el --- Support for European languages
2
fa526c4a
RS
3;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
4;; Licensed to the Free Software Foundation.
4ed46869
KH
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
369314dc
KH
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.
4ed46869
KH
24
25;;; Commentary:
26
27;; For Europeans, five character sets ISO8859-1,2,3,4,9 are supported.
28
29;;; Code:
30
3d48f828
RS
31(define-prefix-command 'describe-european-environment-map)
32(define-key-after describe-language-environment-map [European]
33 '("European" . describe-european-environment-map)
335a7ad7
KH
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
740cfcfd 41;; Setup for LANGAUGE which uses one-byte 8-bit CHARSET, one-byte
335a7ad7 42;; 8-bit CODING-SYSTEM, and INPUT-METHOD.
740cfcfd 43(defun setup-8-bit-environment (language charset coding-system input-method)
335a7ad7
KH
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)
4b9121fc 50 (setq sendmail-coding-system coding-system
335a7ad7
KH
51 rmail-file-coding-system coding-system)
52
53 (if charset
3d48f828
RS
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)))
335a7ad7
KH
58
59 (if input-method
740cfcfd
KH
60 (setq 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))))
335a7ad7 66\f
5c4794f3 67;; Latin-1 (ISO-8859-1)
335a7ad7 68
4ed46869 69(make-coding-system
4b9121fc
KH
70 'iso-latin-1 2 ?1
71 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-1, Compound Text Encoding)"
4ed46869
KH
72 '((ascii t) (latin-iso8859-1 t) nil nil
73 nil ascii-eol ascii-cntl))
74
71eabd24
RS
75(define-coding-system-alias 'iso-8859-1 'iso-latin-1)
76(define-coding-system-alias 'ctext 'iso-latin-1)
4ed46869 77
335a7ad7 78(defun setup-latin1-environment ()
5c4794f3 79 "Set up multilingual environment (MULE) for European Latin-1 users."
335a7ad7 80 (interactive)
740cfcfd
KH
81 (setup-8-bit-environment "Latin-1" 'latin-iso8859-1 'iso-latin-1
82 "latin-1-prefix"))
335a7ad7
KH
83
84(set-language-info-alist
5c4794f3
RS
85 "Latin-1" '((setup-function . (setup-latin1-environment
86 . setup-european-environment-map))
87 (charset . (ascii latin-iso8859-1))
4b9121fc 88 (coding-system . (iso-latin-1))
5c4794f3
RS
89 (sample-text
90 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
91 (documentation . ("\
60763153
RS
92These languages are supported with the Latin-1 (ISO-8859-1) character set:
93 Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
94 Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish.
3d48f828 95" . describe-european-environment-map))
5c4794f3 96 ))
335a7ad7 97\f
5c4794f3 98;; Latin-2 (ISO-8859-2)
335a7ad7 99
4ed46869 100(make-coding-system
4b9121fc
KH
101 'iso-latin-2 2 ?2
102 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
4ed46869
KH
103 '((ascii t) (latin-iso8859-2 t) nil nil
104 nil ascii-eol ascii-cntl nil nil nil nil))
105
71eabd24 106(define-coding-system-alias 'iso-8859-2 'iso-latin-2)
4b9121fc 107
335a7ad7 108(defun setup-latin2-environment ()
5c4794f3 109 "Set up multilingual environment (MULE) for European Latin-2 users."
335a7ad7 110 (interactive)
740cfcfd
KH
111 (setup-8-bit-environment "Latin-2" 'latin-iso8859-2 'iso-latin-2
112 "latin-2-prefix"))
335a7ad7
KH
113
114(set-language-info-alist
5c4794f3
RS
115 "Latin-2" '((setup-function . (setup-latin2-environment
116 . setup-european-environment-map))
117 (charset . (ascii latin-iso8859-2))
4b9121fc 118 (coding-system . (iso-latin-2))
5c4794f3 119 (documentation . ("\
60763153
RS
120These languages are supported with the Latin-2 (ISO-8859-2) character set:
121 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
99616935 122 Serbo-Croatian or Croatian, Slovak, Slovene, and Swedish.
3d48f828 123" . describe-european-environment-map))
5c4794f3 124 ))
335a7ad7 125\f
5c4794f3 126;; Latin-3 (ISO-8859-3)
335a7ad7 127
4ed46869 128(make-coding-system
4b9121fc
KH
129 'iso-latin-3 2 ?3
130 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
4ed46869
KH
131 '((ascii t) (latin-iso8859-3 t) nil nil
132 nil ascii-eol ascii-cntl nil nil nil nil))
133
71eabd24 134(define-coding-system-alias 'iso-8859-3 'iso-latin-3)
4b9121fc 135
335a7ad7 136(defun setup-latin3-environment ()
5c4794f3 137 "Set up multilingual environment (MULE) for European Latin-3 users."
335a7ad7 138 (interactive)
740cfcfd
KH
139 (setup-8-bit-environment "Latin-3" 'latin-iso8859-3 'iso-latin-3
140 "latin-3-prefix"))
335a7ad7
KH
141
142(set-language-info-alist
5c4794f3
RS
143 "Latin-3" '((setup-function . (setup-latin3-environment
144 . setup-european-environment-map))
145 (charset . (ascii latin-iso8859-3))
4b9121fc 146 (coding-system . (iso-latin-3))
5c4794f3 147 (documentation . ("\
60763153
RS
148These 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.
3d48f828 151" . describe-european-environment-map))
5c4794f3 152 ))
335a7ad7 153\f
5c4794f3 154;; Latin-4 (ISO-8859-4)
335a7ad7 155
4ed46869 156(make-coding-system
4b9121fc
KH
157 'iso-latin-4 2 ?4
158 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)"
4ed46869
KH
159 '((ascii t) (latin-iso8859-4 t) nil nil
160 nil ascii-eol ascii-cntl nil nil nil nil))
161
71eabd24 162(define-coding-system-alias 'iso-8859-4 'iso-latin-4)
4b9121fc 163
335a7ad7 164(defun setup-latin4-environment ()
5c4794f3 165 "Set up multilingual environment (MULE) for European Latin-4 users."
335a7ad7 166 (interactive)
740cfcfd
KH
167 (setup-8-bit-environment "Latin-4" 'latin-iso8859-4 'iso-latin-4
168 "latin-4-prefix"))
335a7ad7
KH
169
170(set-language-info-alist
5c4794f3
RS
171 "Latin-4" '((setup-function . (setup-latin4-environment
172 . setup-european-environment-map))
173 (charset . (ascii latin-iso8859-4))
174 (coding-system . (iso-8859-4))
175 (documentation . ("\
60763153
RS
176These languages are supported with the Latin-4 (ISO-8859-4) character set:
177 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
178 Latvian, Lithuanian, and Norwegian.
3d48f828 179" . describe-european-environment-map))
5c4794f3 180 ))
335a7ad7 181\f
5c4794f3 182;; Latin-5 (ISO-8859-9)
335a7ad7 183
4ed46869 184(make-coding-system
4b9121fc
KH
185 'iso-latin-5 2 ?9
186 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
4ed46869
KH
187 '((ascii t) (latin-iso8859-9 t) nil nil
188 nil ascii-eol ascii-cntl nil nil nil nil))
189
71eabd24 190(define-coding-system-alias 'iso-8859-9 'iso-latin-5)
4b9121fc 191
335a7ad7 192(defun setup-latin5-environment ()
5c4794f3 193 "Set up multilingual environment (MULE) for European Latin-5 users."
335a7ad7 194 (interactive)
740cfcfd
KH
195 (setup-8-bit-environment "Latin-5" 'latin-iso8859-9 'iso-latin-5
196 "latin-5-prefix"))
4ed46869 197
4ed46869 198(set-language-info-alist
5c4794f3
RS
199 "Latin-5" '((setup-function . (setup-latin5-environment
200 . setup-european-environment-map))
201 (charset . (ascii latin-iso8859-9))
4b9121fc 202 (coding-system . (iso-latin-5))
5c4794f3
RS
203 (documentation . ("\
204These languages are supported with the Latin-5 (ISO-8859-9) character set.
3d48f828 205" . describe-european-environment-map))
5c4794f3 206 ))
8dfef503 207
4ed46869 208;;; european.el ends here