Mercurial > hg > xemacs-beta
comparison lisp/language/cyrillic.el @ 213:78f53ef88e17 r20-4b5
Import from CVS: tag r20-4b5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:06:47 +0200 |
parents | 41ff10fd062f |
children |
comparison
equal
deleted
inserted
replaced
212:d8688acf4c5b | 213:78f53ef88e17 |
---|---|
92 . describe-cyrillic-environment-map)))) | 92 . describe-cyrillic-environment-map)))) |
93 | 93 |
94 ;; KOI-8 staff | 94 ;; KOI-8 staff |
95 | 95 |
96 (define-ccl-program ccl-decode-koi8 | 96 (define-ccl-program ccl-decode-koi8 |
97 '(((read r0) | 97 '(3 |
98 ((read r0) | |
98 (loop | 99 (loop |
99 (write-read-repeat | 100 (write-read-repeat |
100 r0 | 101 r0 |
101 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 102 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
102 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 103 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
103 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | 104 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
104 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 105 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
105 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 106 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
106 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | 107 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
115 ?,LN(B ?,L0(B ?,L1(B ?,LF(B ?,L4(B ?,L5(B ?,LD(B ?,L3(B ?,LE(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B | 116 ?,LN(B ?,L0(B ?,L1(B ?,LF(B ?,L4(B ?,L5(B ?,LD(B ?,L3(B ?,LE(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B |
116 ?,L?(B ?,LO(B ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,L6(B ?,L2(B ?,LL(B ?,LK(B ?,L7(B ?,LH(B ?,LM(B ?,LI(B ?,LG(B ?,LJ(B ])))) | 117 ?,L?(B ?,LO(B ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,L6(B ?,L2(B ?,LL(B ?,LK(B ?,L7(B ?,LH(B ?,LM(B ?,LI(B ?,LG(B ?,LJ(B ])))) |
117 "CCL program to decode KOI8.") | 118 "CCL program to decode KOI8.") |
118 | 119 |
119 (define-ccl-program ccl-encode-koi8 | 120 (define-ccl-program ccl-encode-koi8 |
120 '(((read r0) | 121 `(1 |
122 ((read r0) | |
121 (loop | 123 (loop |
122 (if (r0 != 140) ; lc-crl == 140 | 124 (if (r0 != ,(charset-id 'cyrillic-iso8859-5)) |
123 (write-read-repeat r0) | 125 (write-read-repeat r0) |
124 ((read r0) | 126 ((read r0) |
125 (r0 -= 160) | 127 (r0 -= 160) |
126 (write-read-repeat | 128 (write-read-repeat |
127 r0 | 129 r0 |
128 [ 32 179 32 32 32 32 32 32 32 32 32 32 32 32 32 32 | 130 [ 32 179 32 32 32 32 32 32 32 32 32 32 32 32 32 32 |
131 225 226 247 231 228 229 246 250 233 234 235 236 237 238 239 240 | |
132 242 243 244 245 230 232 227 254 251 253 255 249 248 252 224 241 | |
133 193 194 215 199 196 197 214 218 201 202 203 204 205 206 207 208 | |
134 210 211 212 213 198 200 195 222 219 221 223 217 216 220 192 209 | |
135 32 163 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) | |
136 ))))) | |
137 "CCL program to encode KOI8.") | |
138 | |
139 ;(make-coding-system | |
140 ; 'cyrillic-koi8 4 | |
141 ; ;; We used to use ?K. It is true that ?K is more strictly correct, | |
142 ; ;; but it is also used for Korean. | |
143 ; ;; So people who use koi8 for languages other than Russian | |
144 ; ;; will have to forgive us. | |
145 ; ?R "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)" | |
146 ; (cons ccl-decode-koi8 ccl-encode-koi8)) | |
147 | |
148 ;(define-coding-system-alias 'koi8-r 'cyrillic-koi8) | |
149 ;(define-coding-system-alias 'koi8 'cyrillic-koi8) | |
150 | |
151 ;(make-coding-system | |
152 ; 'koi8-r 'ccl | |
153 ; "Coding-system used for KOI8-R." | |
154 ; `(decode ,ccl-decode-koi8 | |
155 ; encode ,ccl-encode-koi8 | |
156 ; mnemonic "KOI8")) | |
157 | |
158 ;(define-coding-system-alias 'koi8-r 'koi8) | |
159 | |
160 (define-ccl-program ccl-encode-koi8-font | |
161 '(0 | |
162 ((r1 -= 160) | |
163 (r1 = r1 | |
164 [ 32 179 32 32 32 32 32 32 32 32 32 32 32 32 32 32 | |
129 225 226 247 231 228 229 246 250 233 234 235 236 237 238 239 240 | 165 225 226 247 231 228 229 246 250 233 234 235 236 237 238 239 240 |
130 242 243 244 245 230 232 227 254 251 253 255 249 248 252 224 241 | 166 242 243 244 245 230 232 227 254 251 253 255 249 248 252 224 241 |
131 193 194 215 199 196 197 214 218 201 202 203 204 205 206 207 208 | 167 193 194 215 199 196 197 214 218 201 202 203 204 205 206 207 208 |
132 210 211 212 213 198 200 195 222 219 221 223 217 216 220 192 209 | 168 210 211 212 213 198 200 195 222 219 221 223 217 216 220 192 209 |
133 32 163 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) | 169 32 163 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) |
134 ))))) | |
135 "CCL program to encode KOI8.") | |
136 | |
137 ;; (make-coding-system | |
138 ;; 'cyrillic-koi8 4 | |
139 ;; ;; We used to use ?K. It is true that ?K is more strictly correct, | |
140 ;; ;; but it is also used for Korean. | |
141 ;; ;; So people who use koi8 for languages other than Russian | |
142 ;; ;; will have to forgive us. | |
143 ;; ?R "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)" | |
144 ;; (cons ccl-decode-koi8 ccl-encode-koi8)) | |
145 | |
146 ;; (define-coding-system-alias 'koi8-r 'cyrillic-koi8) | |
147 ;; (define-coding-system-alias 'koi8 'cyrillic-koi8) | |
148 | |
149 ;; (make-coding-system | |
150 ;; 'koi8-r 'ccl | |
151 ;; "Coding-system used for KOI8-R." | |
152 ;; `(decode ,ccl-decode-koi8 | |
153 ;; encode ,ccl-encode-koi8 | |
154 ;; mnemonic "KOI8")) | |
155 | |
156 ;;(define-coding-system-alias 'koi8-r 'koi8) | |
157 | |
158 (define-ccl-program ccl-encode-koi8-font | |
159 '(((r1 -= 160) | |
160 (r1 = r1 | |
161 [ 32 179 32 32 32 32 32 32 32 32 32 32 32 32 32 32 | |
162 225 226 247 231 228 229 246 250 233 234 235 236 237 238 239 240 | |
163 242 243 244 245 230 232 227 254 251 253 255 249 248 252 224 241 | |
164 193 194 215 199 196 197 214 218 201 202 203 204 205 206 207 208 | |
165 210 211 212 213 198 200 195 222 219 221 223 217 216 220 192 209 | |
166 32 163 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) | |
167 )) | 170 )) |
168 "CCL program to encode Cyrillic chars to KOI font.") | 171 "CCL program to encode Cyrillic chars to KOI font.") |
169 | 172 |
170 ;; (setq font-ccl-encoder-alist | 173 ;; (setq font-ccl-encoder-alist |
171 ;; (cons (cons "koi8" ccl-encode-koi8-font) font-ccl-encoder-alist)) | 174 ;; (cons (cons "koi8" ccl-encode-koi8-font) font-ccl-encoder-alist)) |
180 . describe-cyrillic-environment-map)))) | 183 . describe-cyrillic-environment-map)))) |
181 | 184 |
182 ;;; ALTERNATIVNYJ staff | 185 ;;; ALTERNATIVNYJ staff |
183 | 186 |
184 (define-ccl-program ccl-decode-alternativnyj | 187 (define-ccl-program ccl-decode-alternativnyj |
185 '(((read r0) | 188 '(3 |
189 ((read r0) | |
186 (loop | 190 (loop |
187 (write-read-repeat | 191 (write-read-repeat |
188 r0 | 192 r0 |
189 [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 193 [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
190 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 194 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
191 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | 195 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
192 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 196 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
193 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 197 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
194 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | 198 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
195 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | 199 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
196 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | 200 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
197 ?,L0(B ?,L1(B ?,L2(B ?,L3(B ?,L4(B ?,L5(B ?,L6(B ?,L7(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B ?,L?(B | 201 ?,L0(B ?,L1(B ?,L2(B ?,L3(B ?,L4(B ?,L5(B ?,L6(B ?,L7(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B ?,L?(B |
198 ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,LD(B ?,LE(B ?,LF(B ?,LG(B ?,LH(B ?,LI(B ?,LJ(B ?,LK(B ?,LL(B ?,LM(B ?,LN(B ?,LO(B | 202 ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,LD(B ?,LE(B ?,LF(B ?,LG(B ?,LH(B ?,LI(B ?,LJ(B ?,LK(B ?,LL(B ?,LM(B ?,LN(B ?,LO(B |
199 ?,LP(B ?,LQ(B ?,LR(B ?,LS(B ?,LT(B ?,LU(B ?,LV(B ?,LW(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B ?,L_(B | 203 ?,LP(B ?,LQ(B ?,LR(B ?,LS(B ?,LT(B ?,LU(B ?,LV(B ?,LW(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B ?,L_(B |
200 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 | 204 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 |
201 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 | 205 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 |
202 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 | 206 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 |
203 ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,Ld(B ?,Le(B ?,Lf(B ?,Lg(B ?,Lh(B ?,Li(B ?,Lj(B ?,Lk(B ?,Ll(B ?,Lm(B ?,Ln(B ?,Lo(B | 207 ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,Ld(B ?,Le(B ?,Lf(B ?,Lg(B ?,Lh(B ?,Li(B ?,Lj(B ?,Lk(B ?,Ll(B ?,Lm(B ?,Ln(B ?,Lo(B |
204 ?,L!(B ?,Lq(B 32 32 32 32 32 32 32 32 32 32 32 32 32 ?,Lp(B])))) | 208 ?,L!(B ?,Lq(B 32 32 32 32 32 32 32 32 32 32 32 32 32 ?,Lp(B])))) |
205 "CCL program to decode Alternativnyj.") | 209 "CCL program to decode Alternativnyj.") |
206 | 210 |
207 (define-ccl-program ccl-encode-alternativnyj | 211 (define-ccl-program ccl-encode-alternativnyj |
208 '(((read r0) | 212 `(1 |
213 ((read r0) | |
209 (loop | 214 (loop |
210 (if (r0 != 140) ; lc-crl == 140 | 215 (if (r0 != ,(charset-id 'cyrillic-iso8859-5)) |
211 (write-read-repeat r0) | 216 (write-read-repeat r0) |
212 ((read r0) | 217 ((read r0) |
213 (r0 -= 160) | 218 (r0 -= 160) |
214 (write-read-repeat | 219 (write-read-repeat |
215 r0 | 220 r0 |
216 [ 32 240 32 32 32 32 32 32 32 32 32 32 32 32 32 32 | 221 [ 32 240 32 32 32 32 32 32 32 32 32 32 32 32 32 32 |
217 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | 222 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
218 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | 223 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
219 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | 224 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
220 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | 225 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
221 255 241 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) | 226 255 241 32 32 32 32 32 32 32 32 32 32 32 32 32 32]) |
222 ))))) | 227 ))))) |
223 "CCL program to encode Alternativnyj.") | 228 "CCL program to encode Alternativnyj.") |
224 | 229 |
225 ;; (make-coding-system | 230 ;; (make-coding-system |
226 ;; 'alternativnyj 4 | 231 ;; 'alternativnyj 4 |
227 ;; ?A "Coding-system used for Alternativnyj" | 232 ;; ?A "Coding-system used for Alternativnyj" |
233 `(decode ,ccl-decode-alternativnyj | 238 `(decode ,ccl-decode-alternativnyj |
234 encode ,ccl-encode-alternativnyj | 239 encode ,ccl-encode-alternativnyj |
235 mnemonic "Cy.Alt")) | 240 mnemonic "Cy.Alt")) |
236 | 241 |
237 (define-ccl-program ccl-encode-alternativnyj-font | 242 (define-ccl-program ccl-encode-alternativnyj-font |
238 '(((r1 -= 160) | 243 '(0 |
244 ((r1 -= 160) | |
239 (r1 = r1 | 245 (r1 = r1 |
240 [ 32 240 32 32 32 32 32 32 32 32 32 32 32 32 32 32 | 246 [ 32 240 32 32 32 32 32 32 32 32 32 32 32 32 32 32 |
241 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | 247 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
242 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | 248 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
243 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | 249 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
259 (documentation . ("Support for Cyrillic ALTERNATIVNYJ." | 265 (documentation . ("Support for Cyrillic ALTERNATIVNYJ." |
260 . describe-cyrillic-environment-map)))) | 266 . describe-cyrillic-environment-map)))) |
261 | 267 |
262 ;;; GENERAL | 268 ;;; GENERAL |
263 | 269 |
264 ;; (defun setup-cyrillic-environment () | 270 (defun setup-cyrillic-environment () |
265 ;; "Setup multilingual environment for Cyrillic users." | 271 "Setup multilingual environment for Cyrillic users." |
266 ;; (interactive) | 272 (interactive) |
267 ;; (setq primary-language "Cyrillic") | 273 (setq primary-language "Cyrillic") |
268 ;; | 274 |
269 ;; (setq coding-category-iso-8-1 'iso-8859-5) | 275 (setq coding-category-iso-8-1 'iso-8859-5) |
270 ;; | 276 |
271 ;; (set-coding-priority | 277 (set-coding-priority |
272 ;; '(coding-category-iso-7 | 278 '(coding-category-iso-7 |
273 ;; coding-category-iso-8-1)) | 279 coding-category-iso-8-1)) |
274 ;; | 280 |
275 ;; (setq-default buffer-file-coding-system 'iso-8859-5) | 281 (setq-default buffer-file-coding-system 'iso-8859-5) |
276 ;; (set-terminal-coding-system 'iso-8859-5) | 282 (set-terminal-coding-system 'iso-8859-5) |
277 ;; (set-keyboard-coding-system 'iso-8859-5) | 283 (set-keyboard-coding-system 'iso-8859-5) |
278 ;; | 284 |
279 ;; (setq default-input-method '("Cyrillic" . "quail-yawerty")) | 285 (setq default-input-method '("Cyrillic" . "quail-yawerty")) |
280 ;; ) | 286 ) |
281 | 287 |
282 ;; (defun describe-cyrillic-support () | 288 (defun describe-cyrillic-support () |
283 ;; "Describe how Emacs support Cyrillic." | 289 "Describe how Emacs support Cyrillic." |
284 ;; (interactive) | 290 (interactive) |
285 ;; (describe-language-support-internal "Cyrillic")) | 291 (describe-language-support-internal "Cyrillic")) |
286 | 292 |
287 ;; (set-language-info-alist | 293 (set-language-info-alist |
288 ;; "Cyrillic" '((setup-function . setup-cyrillic-environment) | 294 "Cyrillic" '((setup-function . setup-cyrillic-environment) |
289 ;; (describe-function . describe-cyrillic-support) | 295 (describe-function . describe-cyrillic-support) |
290 ;; (charset . (cyrillic-iso8859-5)) | 296 (charset . (cyrillic-iso8859-5)) |
291 ;; (coding-system . (iso-8859-5 koi8-r alternativnyj)) | 297 (coding-system . (iso-8859-5 koi8-r alternativnyj)) |
292 ;; (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") | 298 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") |
293 ;; (documentation . nil))) | 299 (documentation . nil))) |
294 | 300 |
295 ;;; cyrillic.el ends here | 301 ;;; cyrillic.el ends here |