Mercurial > hg > xemacs-beta
comparison lisp/language/european.el @ 159:3bb7ccffb0c0 r20-3b6
Import from CVS: tag r20-3b6
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:41:43 +0200 |
parents | |
children | 929b76928fce |
comparison
equal
deleted
inserted
replaced
158:558dfa75ffb3 | 159:3bb7ccffb0c0 |
---|---|
1 ;;; european.el --- Support for European languages | |
2 | |
3 ;; Copyright (C) 1995 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
5 ;; Copyright (C) 1997 MORIOKA Tomohiko | |
6 | |
7 ;; Keywords: multilingual, European | |
8 | |
9 ;; This file is part of XEmacs. | |
10 | |
11 ;; XEmacs is free software; you can redistribute it and/or modify it | |
12 ;; under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; XEmacs is distributed in the hope that it will be useful, but | |
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 ;; General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
24 ;; 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;; For Europeans, five character sets ISO8859-1,2,3,4,9 are supported. | |
29 | |
30 ;;; Code: | |
31 | |
32 ;; For syntax of Latin-1 characters. | |
33 (loop for c from 64 to 127 ; from '.AN@' to 'N' | |
34 do (modify-syntax-entry (make-char 'latin-iso8859-1 c) "w")) | |
35 | |
36 (modify-syntax-entry (make-char 'latin-iso8859-1 32) "w") ; no-break space | |
37 (modify-syntax-entry ?NW "_") | |
38 (modify-syntax-entry ?Nw "_") | |
39 | |
40 ;; For syntax of Latin-2 | |
41 (loop for c in '(?.BN! ?N# ?N% ?N& ?N) ?N* ?N+ ?N, ?N. ?N/ ?N1 ?N3 ?N5 ?N6 ?N9 ?N: ?N; ?N<) | |
42 do (modify-syntax-entry c "w")) | |
43 | |
44 (loop for c from 62 to 126 | |
45 do (modify-syntax-entry (make-char 'latin-iso8859-2 c) "w")) | |
46 | |
47 (modify-syntax-entry (make-char 'latin-iso8859-2 32) "w") ; no-break space | |
48 (modify-syntax-entry ?NW ".") | |
49 (modify-syntax-entry ?Nw ".") | |
50 | |
51 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
52 ;;; EUROPEANS | |
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
54 | |
55 (define-language-environment 'european | |
56 "European (for Latin-1 through Latin-5)" | |
57 (lambda () | |
58 (set-coding-category-system 'iso-8-designate 'iso-8859-1) | |
59 (set-coding-priority-list '(iso-8-designate iso-8-1)) | |
60 ;;(setq locale-coding-system 'no-conversion) ; iso-8859-1 | |
61 (set-default-buffer-file-coding-system 'no-conversion) ; iso-8859-1 | |
62 ;;(set-buffer-file-coding-system-for-read 'no-conversion) ; iso-8859-1 | |
63 ;;(setq display-coding-system 'iso-8859-1) | |
64 ;;(setq keyboard-coding-system 'iso-8859-1) | |
65 ;; (setq-default quail-current-package | |
66 ;; (assoc "latin-1" quail-package-alist)) | |
67 )) | |
68 | |
69 ;; (make-coding-system | |
70 ;; 'iso-8859-1 2 ?X | |
71 ;; "Coding-system used in X as Compound Text Encoding." | |
72 ;; '((ascii t) (latin-iso8859-1 t) nil nil | |
73 ;; nil ascii-eol ascii-cntl)) | |
74 | |
75 ;; CTEXT is an alias for ISO-8859-1 | |
76 ;; (define-coding-system-alias 'iso-8859-1 'ctext) | |
77 | |
78 ;; (make-coding-system | |
79 ;; 'iso-8859-2 2 ?2 "MIME ISO-8859-2" | |
80 ;; '((ascii t) (latin-iso8859-2 t) nil nil | |
81 ;; nil ascii-eol ascii-cntl nil nil nil nil)) | |
82 | |
83 (make-coding-system | |
84 'iso-8859-2 'iso2022 "MIME ISO-8859-2" | |
85 '(charset-g0 ascii | |
86 charset-g1 latin-iso8859-2 | |
87 charset-g2 t | |
88 charset-g3 t | |
89 mnemonic "MIME/Ltn-2" | |
90 )) | |
91 | |
92 ;; (make-coding-system | |
93 ;; 'iso-8859-3 2 ?3 "MIME ISO-8859-3" | |
94 ;; '((ascii t) (latin-iso8859-3 t) nil nil | |
95 ;; nil ascii-eol ascii-cntl nil nil nil nil)) | |
96 | |
97 (make-coding-system | |
98 'iso-8859-3 'iso2022 "MIME ISO-8859-3" | |
99 '(charset-g0 ascii | |
100 charset-g1 latin-iso8859-3 | |
101 charset-g2 t | |
102 charset-g3 t | |
103 mnemonic "MIME/Ltn-3" | |
104 )) | |
105 | |
106 ;; (make-coding-system | |
107 ;; 'iso-8859-4 2 ?4 "MIME ISO-8859-4" | |
108 ;; '((ascii t) (latin-iso8859-4 t) nil nil | |
109 ;; nil ascii-eol ascii-cntl nil nil nil nil)) | |
110 | |
111 (make-coding-system | |
112 'iso-8859-4 'iso2022 "MIME ISO-8859-4" | |
113 '(charset-g0 ascii | |
114 charset-g1 latin-iso8859-4 | |
115 charset-g2 t | |
116 charset-g3 t | |
117 mnemonic "MIME/Ltn-4" | |
118 )) | |
119 | |
120 ;; (make-coding-system | |
121 ;; 'iso-8859-9 2 ?9 "MIME ISO-8859-9" | |
122 ;; '((ascii t) (latin-iso8859-9 t) nil nil | |
123 ;; nil ascii-eol ascii-cntl nil nil nil nil)) | |
124 | |
125 (make-coding-system | |
126 'iso-8859-9 'iso2022 "MIME ISO-8859-9" | |
127 '(charset-g0 ascii | |
128 charset-g1 latin-iso8859-9 | |
129 charset-g2 t | |
130 charset-g3 t | |
131 mnemonic "MIME/Ltn-5" | |
132 )) | |
133 | |
134 (register-input-method "European" | |
135 '("quail-latin-1" quail-use-package "quail/latin")) | |
136 (register-input-method "European" | |
137 '("quail-latin-2" quail-use-package "quail/latin")) | |
138 (register-input-method "European" | |
139 '("quail-latin-3" quail-use-package "quail/latin")) | |
140 (register-input-method "European" | |
141 '("quail-latin-4" quail-use-package "quail/latin")) | |
142 (register-input-method "European" | |
143 '("quail-latin-5" quail-use-package "quail/latin")) | |
144 | |
145 (defun setup-european-environment () | |
146 "Setup multilingual environment (MULE) for European languages users. | |
147 It actually reset MULE to the default status, and | |
148 set quail-latin-1 as the default input method to be selected. | |
149 See also the documentation of setup-english-environment." | |
150 (setup-english-environment) | |
151 (setq default-input-method '("European" . "quail-latin-1"))) | |
152 | |
153 (defun describe-european-support () | |
154 "Describe how Emacs support European languages." | |
155 (interactive) | |
156 (describe-language-support-internal "European")) | |
157 | |
158 (set-language-info-alist | |
159 "European" '((setup-function . setup-european-environment) | |
160 (describe-function . describe-european-support) | |
161 (charset . (ascii latin-iso8859-1 latin-iso8859-2 | |
162 latin-iso8859-3 latin-iso8859-4 latin-iso8859-9)) | |
163 (coding-system . (iso-8859-1 iso-8859-2 iso-8859-3 | |
164 iso-8859-4 iso-8859-9)) | |
165 (sample-text | |
166 . "Hello, Hej, Tere, Hei, Bonjour, Gr.AN|N_ Gott, Ciao, N!Hola!") | |
167 (documentation . "\ | |
168 Almost all of European languages are supported by the character sets and | |
169 coding systems listed below. | |
170 To input them, LEIM (Libraries for Emacs Input Methods) should have been | |
171 installed.") | |
172 )) | |
173 | |
174 (let ((languages '("French" "German" "Spanish" "Italian" | |
175 ;; We have to list much more European langauges here. | |
176 )) | |
177 (val '("quail-latin-1" quail-use-package "quail/latin"))) | |
178 (while languages | |
179 (register-input-method (car languages) val) | |
180 (setq languages (cdr languages)))) | |
181 | |
182 ;;; european.el ends here |