european.el 7.29 KB
Newer Older
Karl Heuer's avatar
Karl Heuer committed
1 2
;;; european.el --- Support for European languages

Richard M. Stallman's avatar
Richard M. Stallman committed
3 4
;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
;; Licensed to the Free Software Foundation.
Karl Heuer's avatar
Karl Heuer committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

;; Keywords: multilingual, European

;; This file is part of GNU Emacs.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
Karl Heuer's avatar
Karl Heuer committed
21 22 23
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
Karl Heuer's avatar
Karl Heuer committed
24 25 26 27 28 29 30

;;; Commentary:

;; For Europeans, five character sets ISO8859-1,2,3,4,9 are supported.

;;; Code:

31
;; Latin-1 (ISO-8859-1)
32

Karl Heuer's avatar
Karl Heuer committed
33
(make-coding-system
34
 'iso-latin-1 2 ?1
Kenichi Handa's avatar
Kenichi Handa committed
35 36 37 38 39
 "ISO 2022 based 8-bit encoding for Laint-1 (MIME:ISO-8859-1)"
 '(ascii latin-iso8859-1 nil nil
   nil nil nil nil nil nil nil nil nil nil nil nil t)
 '((safe-charsets ascii latin-iso8859-1)
   (mime-charset . iso-8859-1)))
Karl Heuer's avatar
Karl Heuer committed
40

41
(define-coding-system-alias 'iso-8859-1 'iso-latin-1)
42
(define-coding-system-alias 'latin-1 'iso-latin-1)
Kenichi Handa's avatar
Kenichi Handa committed
43 44 45 46 47 48 49 50 51

(make-coding-system
 'compound-text 2 ?1
 "ISO 2022 based encoding used in inter client communication of X"
 '((ascii t) (latin-iso8859-1 t) nil nil
   nil ascii-eol ascii-cntl nil nil nil nil nil nil nil nil nil t)
 '((safe-charsets . t)))

(define-coding-system-alias 'ctext 'compound-text)
Karl Heuer's avatar
Karl Heuer committed
52

53
(defun setup-latin1-environment ()
54
  "Set up multilingual environment (MULE) for European Latin-1 users."
55
  (interactive)
56
  (set-language-environment "Latin-1"))
57 58

(set-language-info-alist
59
 "Latin-1" '((charset ascii latin-iso8859-1)
Kenichi Handa's avatar
Kenichi Handa committed
60 61
	     (coding-system iso-latin-1)
	     (coding-priority iso-latin-1)
62
	     (nonascii-translation . latin-iso8859-1)
63
	     (unibyte-syntax . "latin-1")
64
	     (unibyte-display . iso-latin-1)
Kenichi Handa's avatar
Kenichi Handa committed
65
	     (input-method . "latin-1-prefix")
66 67
	     (sample-text
	      . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!")
Kenichi Handa's avatar
Kenichi Handa committed
68
	     (documentation . "\
69 70
These languages are supported with the Latin-1 (ISO-8859-1) character set:
 Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
Kenichi Handa's avatar
Kenichi Handa committed
71 72 73
 Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish."))
 '("European"))

74

75
;; Latin-2 (ISO-8859-2)
76

Karl Heuer's avatar
Karl Heuer committed
77
(make-coding-system
78 79
 'iso-latin-2 2 ?2
 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
Kenichi Handa's avatar
Kenichi Handa committed
80 81 82 83
 '(ascii latin-iso8859-2 nil nil
   nil nil nil nil nil nil nil)
 '((safe-charsets ascii latin-iso8859-2)
   (mime-charset . iso-8859-2)))
Karl Heuer's avatar
Karl Heuer committed
84

85
(define-coding-system-alias 'iso-8859-2 'iso-latin-2)
86
(define-coding-system-alias 'latin-2 'iso-latin-2)
87

88
(defun setup-latin2-environment ()
89
  "Set up multilingual environment (MULE) for European Latin-2 users."
90
  (interactive)
91
  (set-language-environment "Laint-2"))
92 93

(set-language-info-alist
94
 "Latin-2" '((charset ascii latin-iso8859-2)
Kenichi Handa's avatar
Kenichi Handa committed
95 96
	     (coding-system iso-latin-2)
	     (coding-priority iso-latin-2)
97
	     (nonascii-translation . latin-iso8859-2)
98
	     (unibyte-syntax . "latin-2")
99
	     (unibyte-display . iso-latin-2)
Kenichi Handa's avatar
Kenichi Handa committed
100
	     (input-method . "latin-2-prefix")
Kenichi Handa's avatar
Kenichi Handa committed
101
	     (documentation . "\
102 103
These languages are supported with the Latin-2 (ISO-8859-2) character set:
 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
104
 Serbo-Croatian or Croatian, Slovak, Slovene, Sorbian (upper and lower),
Kenichi Handa's avatar
Kenichi Handa committed
105 106 107
 and Swedish."))
 '("European"))

108

109
;; Latin-3 (ISO-8859-3)
110

Karl Heuer's avatar
Karl Heuer committed
111
(make-coding-system
112 113
 'iso-latin-3 2 ?3
 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
Kenichi Handa's avatar
Kenichi Handa committed
114 115 116 117
 '(ascii latin-iso8859-3 nil nil
   nil nil nil nil nil nil nil)
 '((safe-charsets ascii latin-iso8859-3)
   (mime-charset . iso-8859-3)))
Karl Heuer's avatar
Karl Heuer committed
118

119
(define-coding-system-alias 'iso-8859-3 'iso-latin-3)
120
(define-coding-system-alias 'latin-3 'iso-latin-3)
121

122
(defun setup-latin3-environment ()
123
  "Set up multilingual environment (MULE) for European Latin-3 users."
124
  (interactive)
125
  (set-language-environment "Latin-3"))
126 127

(set-language-info-alist
128
 "Latin-3" '((charset ascii latin-iso8859-3)
Kenichi Handa's avatar
Kenichi Handa committed
129 130
	     (coding-system iso-latin-3)
	     (coding-priority iso-latin-3)
131
	     (nonascii-translation . latin-iso8859-3)
132
	     (unibyte-syntax . "latin-3")
133
	     (unibyte-display . iso-latin-3)
Kenichi Handa's avatar
Kenichi Handa committed
134
	     (input-method . "latin-3-prefix")
Kenichi Handa's avatar
Kenichi Handa committed
135
	     (documentation . "\
136 137
These languages are supported with the Latin-3 (ISO-8859-3) character set:
 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
Kenichi Handa's avatar
Kenichi Handa committed
138 139 140
 German, Italian, Maltese, Spanish, and Turkish."))
 '("European"))

141

142
;; Latin-4 (ISO-8859-4)
143

Karl Heuer's avatar
Karl Heuer committed
144
(make-coding-system
145 146
 'iso-latin-4 2 ?4
 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)"
Kenichi Handa's avatar
Kenichi Handa committed
147 148 149 150
 '(ascii latin-iso8859-4 nil nil
   nil nil nil nil nil nil nil)
 '((safe-charsets ascii latin-iso8859-4)
   (mime-charset . iso-8895-4)))
Karl Heuer's avatar
Karl Heuer committed
151

152
(define-coding-system-alias 'iso-8859-4 'iso-latin-4)
153
(define-coding-system-alias 'latin-4 'iso-latin-4)
154

155
(defun setup-latin4-environment ()
156
  "Set up multilingual environment (MULE) for European Latin-4 users."
157
  (interactive)
158
  (set-language-environment "Latin-4"))
159 160

(set-language-info-alist
161
 "Latin-4" '((charset ascii latin-iso8859-4)
Kenichi Handa's avatar
Kenichi Handa committed
162 163
	     (coding-system iso-8859-4)
	     (coding-priority iso-8859-4)
164
	     (nonascii-translation . latin-iso8859-4)
165
	     (unibyte-syntax . "latin-4")
166
	     (unibyte-display . iso-8859-4)
Kenichi Handa's avatar
Kenichi Handa committed
167
	     (input-method . "latin-4-prefix")
Kenichi Handa's avatar
Kenichi Handa committed
168
	     (documentation . "\
169 170
These languages are supported with the Latin-4 (ISO-8859-4) character set:
 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
Kenichi Handa's avatar
Kenichi Handa committed
171 172 173
 Latvian, Lithuanian, and Norwegian."))
 '("European"))

174

175
;; Latin-5 (ISO-8859-9)
176

Karl Heuer's avatar
Karl Heuer committed
177
(make-coding-system
178 179
 'iso-latin-5 2 ?9
 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
Kenichi Handa's avatar
Kenichi Handa committed
180 181 182 183
 '(ascii latin-iso8859-9 nil nil
   nil nil nil nil nil nil nil)
 '((safe-charsets ascii latin-iso8859-9)
   (mime-charset . iso-8859-9)))
Karl Heuer's avatar
Karl Heuer committed
184

185
(define-coding-system-alias 'iso-8859-9 'iso-latin-5)
186
(define-coding-system-alias 'latin-5 'iso-latin-5)
187

188
(defun setup-latin5-environment ()
189
  "Set up multilingual environment (MULE) for European Latin-5 users."
190
  (interactive)
191
  (set-language-environment "Latin-5"))
Kenichi Handa's avatar
Kenichi Handa committed
192 193

(set-language-info-alist
194
 "Latin-5" '((charset ascii latin-iso8859-9)
Kenichi Handa's avatar
Kenichi Handa committed
195 196
	     (coding-system iso-latin-5)
	     (coding-priority iso-latin-5)
197
	     (nonascii-translation . latin-iso8859-9)
198
	     (unibyte-syntax . "latin-5")
199
	     (unibyte-display . iso-latin-5)
Kenichi Handa's avatar
Kenichi Handa committed
200
	     (input-method . "latin-5-prefix")
Kenichi Handa's avatar
Kenichi Handa committed
201 202 203 204 205 206 207 208
	     (documentation . "\
These languages are supported with the Latin-5 (ISO-8859-9) character set."))
 '("European"))


(defun setup-german-environment ()
  "Set up multilingual environment (MULE) for German users."
  (interactive)
209
  (set-language-environment "German"))
Karl Heuer's avatar
Karl Heuer committed
210 211

(set-language-info-alist
212
 "German" '((tutorial . "TUTORIAL.de")
Kenichi Handa's avatar
Kenichi Handa committed
213 214 215
	    (charset ascii latin-iso8859-1)
	    (coding-system iso-latin-1)
	    (coding-priority iso-latin-1)
Kenichi Handa's avatar
Kenichi Handa committed
216
	    (input-method . "german-postfix")
217
	    (nonascii-translation . iso-latin-1)
218
	    (unibyte-syntax . "latin-1")
219
	    (unibyte-display . iso-latin-1)
Kenichi Handa's avatar
Kenichi Handa committed
220 221 222 223 224 225 226
	    (sample-text . "\
German (Deutsch Nord)	Guten Tag
German (Deutsch S,A|(Bd)	Gr,A|_(B Gott")
	    (documentation . "\
This language environment is almost the same as Latin-1,
but default input method is set to \"german-postfix\"."))
 '("European"))
227

Karl Heuer's avatar
Karl Heuer committed
228
;;; european.el ends here