70
|
1 ;;; vietnamese-hooks-2.el --- pre-loaded support for Vietnamese, part 2.
|
|
2
|
|
3 ;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc.
|
|
4 ;; Copyright (C) 1995 Amdahl Corporation.
|
|
5 ;; Copyright (C) 1995 Sun Microsystems.
|
|
6
|
|
7 ;; This file is part of XEmacs.
|
|
8
|
|
9 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
10 ;; under the terms of the GNU General Public License as published by
|
|
11 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
12 ;; any later version.
|
|
13
|
|
14 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
17 ;; General Public License for more details.
|
|
18
|
|
19 ;; You should have received a copy of the GNU General Public License
|
|
20 ;; along with XEmacs; see the file COPYING. If not, write to the
|
|
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
22 ;; Boston, MA 02111-1307, USA.
|
|
23
|
|
24 ;;; Synched up with: Mule 2.3.
|
|
25
|
|
26 ;; See comment in vietnamese-hooks-1.el for why we split up the Vietnamese
|
|
27 ;; stuff into two files.
|
|
28
|
|
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
30 ;;; VIETNAMESE
|
|
31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
32
|
|
33 (define-ccl-program ccl-read-viscii
|
|
34 '(((read r0)
|
|
35 (loop
|
|
36 (write-read-repeat
|
|
37 r0
|
138
|
38 [ 0 1 ?-2Æ 3 4 ?Ç ?ç 7 8 9 10 11 12 13 14 15-A
|
|
39 16 17 18 19 ?-2Ö 21 22 23 24 ?Û 26 27 28 29 ?Ü 31-A
|
70
|
40 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
|
41 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
|
42 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
|
43 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
|
44 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
|
45 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
138
|
46 ?-2Õ ?¡ ?¢ ?£ ?¤ ?¥ ?¦ ?§ ?¨ ?© ?ª ?« ?¬ ? ?® ?¯-A
|
|
47 ?-2° ?± ?² ?µ ?þ ?¾ ?¶ ?· ?¸ ?ö ?÷ ?ï ?ü ?û ?ø ?Ï-A
|
|
48 ?-2õ ?-1¡ ?¢ ?£ ?¤ ?¥ ?¦ ?§ ?¨ ?© ?ª ?« ?¬ ? ?® ?¯-A
|
|
49 ?-1° ?± ?² ?-2Þ ?½ ?-1µ ?¶ ?· ?¸ ?-2ñ ?Ñ ?× ?Ø ?-1½ ?¾ ?-2ß-A
|
|
50 ?-2à ?á ?â ?ã ?ä ?å ?-1Æ ?Ç ?-2è ?é ?ê ?ë ?ì ?í ?î ?-1Ï-A
|
|
51 ?-2ð ?-1Ñ ?-2ò ?ó ?ô ?-1Õ ?Ö ?× ?Ø ?-2ù ?ú ?-1Û ?Ü ?-2ý ?-1Þ ?ß-A
|
|
52 ?-1à ?á ?â ?ã ?ä ?å ?æ ?ç ?è ?é ?ê ?ë ?ì ?í ?î ?ï-A
|
|
53 ?-1ð ?ñ ?ò ?ó ?ô ?õ ?ö ?÷ ?ø ?ù ?ú ?û ?ü ?ý ?þ ?-2æ ]))))-A
|
70
|
54 "CCL program to read VISCII 1.1")
|
|
55
|
|
56 (define-ccl-program ccl-write-viscii
|
|
57 '(((read r0)
|
|
58 (loop
|
|
59 (if (r0 < 128)
|
|
60 (write-read-repeat r0)
|
|
61 (if (r0 != 154)
|
|
62 (write-read-repeat r0)
|
|
63 ((read-if (r0 == 163)
|
|
64 ((read r0)
|
|
65 (r0 -= 160)
|
|
66 (write-read-repeat
|
|
67 r0
|
|
68 [ 0 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
|
69 176 177 178 0 0 181 182 183 184 0 0 0 0 189 190 0
|
|
70 0 0 0 0 0 0 198 199 0 0 0 0 0 0 0 207
|
|
71 0 209 0 0 0 213 214 215 216 0 0 219 220 0 222 223
|
|
72 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
|
|
73 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 0
|
|
74 ]))
|
|
75 (if (r0 == 164)
|
|
76 ((read r0)
|
|
77 (r0 -= 160)
|
|
78 (write-read-repeat
|
|
79 r0
|
|
80 [ 0 129 130 131 132 165 134 135 136 137 138 139 140 141 142 143
|
|
81 144 145 146 0 0 147 150 151 152 0 0 0 0 180 149 0
|
|
82 0 0 0 0 0 0 2 5 0 0 0 0 0 0 0 159
|
|
83 0 186 0 0 0 128 20 187 188 0 0 25 30 0 179 191
|
|
84 192 193 194 195 196 197 255 6 200 201 202 203 204 205 206 155
|
|
85 208 185 210 211 212 160 153 154 158 217 218 157 156 221 148 0
|
|
86 ]))
|
|
87 (write-read-repeat r0)))))))))
|
|
88 "CCL program to write VISCII 1.1")
|
|
89
|
|
90 (make-coding-system
|
|
91 'viscii 'ccl
|
|
92 "Coding-system used for VISCII 1.1."
|
|
93 `(mnemonic "VISCII"
|
|
94 decode ,ccl-read-viscii
|
|
95 encode ,ccl-write-viscii))
|
|
96
|
|
97 (make-coding-system
|
|
98 'viqr 'no-conversion
|
|
99 "Coding-system used for VIQR."
|
|
100 '(mnemonic "VIQR"
|
|
101 eol-type lf
|
|
102 post-read-conversion vn-compose-viqr
|
|
103 pre-write-conversion vn-decompose-viqr))
|
|
104
|
|
105 (define-ccl-program ccl-read-vscii
|
|
106 '(((read r0)
|
|
107 (loop
|
|
108 (write-read-repeat r0
|
138
|
109 [0 ?-2ú ?ø 3 ?× ?Ø ?æ 7 8 9 10 11 12 13 14 15-A
|
|
110 16 ?-2Ñ ?ß ?Ï ?Ö ?Û ?ý ?Ü 24 25 26 27 28 29 30 31-A
|
70
|
111 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
|
112 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
|
113 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
|
114 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
|
115 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
|
116 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
138
|
117 ?-2à ?ä ?ã ?á ?Õ ?£ ?§ ?è ?ë ?¨ ?é ?© ?® ?ì ?ï ?î-A
|
|
118 ?-2í ?¸ ?ò ?ö ?õ ?ó ?÷ ?µ ?¶ ?· ?Þ ?¾ ?þ ?ù ?ü ?û-A
|
|
119 160 ?-2å ?â ?ê ?ô ?½ ?ß ?ð ?-1å ?â ?ê ?ô ?¾ ?ù ?ð ?-2¢-A
|
|
120 192 193 194 195 196 ?-1à ?ä ?ã ?á ?Õ ?-2Æ ?-1¢ ?Æ ?Ç ?¡ ?-2Ç-A
|
|
121 ?-2¡ ?¥ ?¦ ?ç ?¥ ?« ?-1£ ?¥ ?¦ ?ç ?¤ ?§ ?è ?-2¬ ?-1ë ?¨-A
|
|
122 ?-1é ?© ?« ?¬ ? ?ª ?® ?ì ?ï ?-2 ?ª ?° ?-1î ?í ?¸ ?ò-A
|
|
123 ?-2± ?-1ö ?õ ?ó ?÷ ?° ?± ?² ?¯ ?µ ?¶ ?· ?Þ ?¾ ?þ ?ù-A
|
|
124 ?-2² ?-1ü ?û ?ú ?ø ?× ?Ø ?æ ?Ñ ?ñ ?Ï ?Ö ?Û ?ý ?Ü ?-2¯]))))-A
|
70
|
125 "CCL program to read VSCII-1.")
|
|
126
|
|
127 (define-ccl-program ccl-write-vscii
|
|
128 '(((read r0)
|
|
129 (loop
|
|
130 (if (r0 < 128)
|
|
131 (write-read-repeat r0)
|
|
132 (if (r0 != 154)
|
|
133 (write-read-repeat r0)
|
|
134 (read-if (r0 == 163)
|
|
135 ((read r0)
|
|
136 (r0 -= 160)
|
|
137 (write-read-repeat
|
|
138 r0
|
|
139 [ 0 190 187 198 202 199 200 203 207 209 213 210 211 212 214 232
|
|
140 229 230 231 0 0 233 234 235 222 0 0 0 0 0 237 0
|
|
141 0 0 0 0 0 0 188 189 0 0 0 0 0 0 0 250
|
|
142 0 248 0 0 0 185 251 245 246 0 0 252 254 0 236 0
|
|
143 181 184 169 183 182 168 247 201 204 208 170 206 215 221 220 216
|
|
144 174 249 223 227 171 226 225 228 244 239 243 242 241 253 238 0
|
|
145 ]))
|
|
146 (if (r0 == 164)
|
|
147 ((read r0)
|
|
148 (r0 -= 160)
|
|
149 (write-read-repeat
|
|
150 r0
|
|
151 [ 0 192 175 133 0 196 194 134 137 139 218 197 205 217 140 255
|
|
152 219 224 240 0 0 151 152 153 145 0 0 0 0 165 155 0
|
|
153 0 0 0 0 0 0 186 191 0 0 0 0 0 0 0 19
|
|
154 0 17 0 0 0 132 20 4 5 0 0 21 23 0 154 166
|
|
155 128 131 162 130 129 161 6 195 135 138 163 136 141 144 143 142
|
|
156 167 0 146 149 164 148 147 150 2 157 1 159 158 22 156 0
|
|
157 ]))
|
|
158 (write-read-repeat r0))))))))
|
|
159 "CCL program to write VSCII-1.")
|
|
160
|
|
161 (make-coding-system
|
|
162 'vscii 'ccl
|
|
163 "Coding-system used for VSCII 1.1."
|
|
164 `(mnemonic "VSCII"
|
|
165 decode ,ccl-read-vscii
|
|
166 encode ,ccl-write-vscii))
|
|
167
|
|
168 (define-ccl-program ccl-vietnamese-lower-to-viscii
|
|
169 '(((r1 = r1
|
|
170 [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
171 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
172 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
173 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
174 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
175 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
176 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
177 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
178 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
179 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
180 0 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
|
181 176 177 178 0 0 181 182 183 184 0 0 0 0 189 190 0
|
|
182 0 0 0 0 0 0 198 199 0 0 0 0 0 0 0 207
|
|
183 0 209 0 0 0 213 214 215 216 0 0 219 220 0 222 223
|
|
184 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
|
|
185 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 0
|
|
186 ])))
|
|
187 "CCL program to convert chars of 'vietnamese-lower to VISCII 1.1 font")
|
|
188
|
|
189 (define-ccl-program ccl-vietnamese-upper-to-viscii
|
|
190 '(((r1 = r1
|
|
191 [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
192 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
193 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
194 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
195 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
196 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
197 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
198 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
199 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
201 0 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
|
202 144 145 146 0 0 147 150 151 152 0 0 0 0 180 149 0
|
|
203 0 0 0 0 0 0 2 5 0 0 0 0 0 0 0 159
|
|
204 0 186 0 0 0 128 20 187 188 0 0 25 30 0 179 191
|
|
205 192 193 194 195 196 197 255 6 200 201 202 203 204 205 206 155
|
|
206 208 185 210 211 212 160 153 154 158 217 218 157 156 221 148 0
|
|
207 ])))
|
|
208 "CCL program to convert chars of 'vietnamese-upper to VISCII 1.1 font")
|
|
209
|
|
210 (define-ccl-program ccl-vietnamese-lower-to-vscii
|
|
211 '(((r1 = r1
|
|
212 [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
213 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
214 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
216 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
217 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
218 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
219 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
220 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
221 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
222 0 190 187 198 202 199 200 203 207 209 213 210 211 212 214 232
|
|
223 229 230 231 0 0 233 234 235 222 0 0 0 0 0 237 0
|
|
224 0 0 0 0 0 0 188 189 0 0 0 0 0 0 0 250
|
|
225 0 248 0 0 0 185 251 245 246 0 0 252 254 0 236 0
|
|
226 181 184 169 183 182 168 247 201 204 208 170 206 215 221 220 216
|
|
227 174 249 223 227 171 226 225 228 244 239 243 242 241 253 238 0
|
|
228 ])))
|
|
229 "CCL program to convert chars of 'vietnamese-lower to VSCII-1 font.")
|
|
230
|
|
231 (define-ccl-program ccl-vietnamese-upper-to-vscii
|
|
232 '(((r1 = r1
|
|
233 [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
234 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
235 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
236 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
237 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
238 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
239 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
240 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
241 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
242 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|
243 0 192 175 133 0 196 194 134 137 139 218 197 205 217 140 255
|
|
244 219 224 240 0 0 151 152 153 145 0 0 0 0 165 155 0
|
|
245 0 0 0 0 0 0 186 191 0 0 0 0 0 0 0 19
|
|
246 0 17 0 0 0 132 20 4 5 0 0 21 23 0 154 166
|
|
247 128 131 162 130 129 161 6 195 135 138 163 136 141 144 143 142
|
|
248 167 0 146 149 164 148 147 150 2 157 1 159 158 22 156 0
|
|
249 ])))
|
|
250 "CCL program to convert chars of 'vietnamese-upper to VSCII-1 font.")
|
|
251
|
|
252 ;; For VISCII users
|
|
253 (set-charset-ccl-program 'vietnamese-lower ccl-vietnamese-lower-to-viscii)
|
|
254 (set-charset-ccl-program 'vietnamese-upper ccl-vietnamese-upper-to-viscii)
|
|
255 ;; For VSCII users
|
|
256 ;; (set-charset-ccl-program 'vietnamese-lower ccl-vietnamese-lower-to-vscii)
|
|
257 ;; (set-charset-ccl-program 'vietnamese-upper ccl-vietnamese-upper-to-vscii)
|
|
258
|
138
|
259 (add-hook 'quail-package-alist '("viqr" "quail-viet"))
|
70
|
260
|
|
261 (define-language-environment 'vietnamese
|
|
262 "Vietnamese"
|
|
263 (lambda ()
|
|
264 ;; For VISCII users
|
|
265 (set-coding-category-system 'no-conversion 'viscii)
|
|
266 ;; For VSCII users
|
|
267 ;; (setq coding-category-system 'binary 'vscii)
|
|
268 (set-coding-priority-list '(no-conversion))
|
110
|
269 (set-default-buffer-file-coding-system 'viscii)
|
70
|
270 (setq-default quail-current-package (assoc "viqr" quail-package-alist))))
|