aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2000-06-06 02:10:04 +0000
committerKenichi Handa2000-06-06 02:10:04 +0000
commit1f487ef8ac423dd78048210836ee37a844d05218 (patch)
treeb1702ea41ef4ff609eb4141c8e9ce248a230dc91
parent0d833551c738ba7ba90243d400264e9cb9fddd1e (diff)
downloademacs-1f487ef8ac423dd78048210836ee37a844d05218.tar.gz
emacs-1f487ef8ac423dd78048210836ee37a844d05218.zip
Remove eval-when-compile.
(cyrillic-koi8-r-nonascii-translation-table): Define it as a translation table made from cyrillic-koi8-r-decode-table. (cyrillic-koi8-r-encode-table): Define it as a translation table made from the reverse map of above. (ccl-decode-koi8): Use translate-character. (ccl-encode-koi8, ccl-encode-koi8-font): Likewize (cyrillic-alternativnyj-nonascii-translation-table): Define it as a translation table made from cyrillic-alternativnyj-decode-table. (cyrillic-alternativnyj-encode-table): Define it as a translation table made from the reverse map of above. (ccl-decode-alternativnyj): Use translate-character. (ccl-encode-alternativnyj, ccl-encode-alternativnyj-font): Likewize
-rw-r--r--lisp/language/cyrillic.el112
1 files changed, 45 insertions, 67 deletions
diff --git a/lisp/language/cyrillic.el b/lisp/language/cyrillic.el
index a4cb9a726e3..e81698c3550 100644
--- a/lisp/language/cyrillic.el
+++ b/lisp/language/cyrillic.el
@@ -57,8 +57,6 @@
57 57
58;; KOI-8 staff 58;; KOI-8 staff
59 59
60(eval-and-compile
61
62(defvar cyrillic-koi8-r-decode-table 60(defvar cyrillic-koi8-r-decode-table
63 [ 61 [
64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 62 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
@@ -79,37 +77,31 @@
79 ?,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 ] 77 ?,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 ]
80 "Cyrillic KOI8-R decoding table.") 78 "Cyrillic KOI8-R decoding table.")
81 79
82(defvar cyrillic-koi8-r-encode-table 80(let ((table (make-translation-table-from-vector
83 (let ((table (make-vector 256 32)) 81 cyrillic-koi8-r-decode-table)))
84 (i 0)) 82 (define-translation-table 'cyrillic-koi8-r-nonascii-translation-table table)
85 (while (< i 256) 83 (define-translation-table 'cyrillic-koi8-r-encode-table
86 (let* ((ch (aref cyrillic-koi8-r-decode-table i)) 84 (char-table-extra-slot table 0)))
87 (split (split-char ch)))
88 (if (eq (car split) 'cyrillic-iso8859-5)
89 (aset table (logior (nth 1 split) 128) i)
90 (if (/= ch 32)
91 (aset table ch i))))
92 (setq i (1+ i)))
93 table)
94 "Cyrillic KOI8-R encoding table.")
95
96)
97 85
98(define-ccl-program ccl-decode-koi8 86(define-ccl-program ccl-decode-koi8
99 `(3 87 `(3
100 ((read r0) 88 ((loop
101 (loop 89 (r0 = 0)
102 (write-read-repeat r0 ,cyrillic-koi8-r-decode-table)))) 90 (read r1)
91 (if (r1 < 128)
92 (write-repeat r1)
93 ((translate-character cyrillic-koi8-r-nonascii-translation-table r0 r1)
94 (write-multibyte-character r0 r1)
95 (repeat))))))
103 "CCL program to decode KOI8.") 96 "CCL program to decode KOI8.")
104 97
105(define-ccl-program ccl-encode-koi8 98(define-ccl-program ccl-encode-koi8
106 `(1 99 `(1
107 ((read r0) 100 ((loop
108 (loop 101 (read-multibyte-character r0 r1)
109 (if (r0 != ,(charset-id 'cyrillic-iso8859-5)) 102 (if (r0 == ,(charset-id 'cyrillic-iso8859-5))
110 (write-read-repeat r0) 103 (translate-character cyrillic-koi8-r-encode-table r0 r1))
111 ((read r0) 104 (write-repeat r1))))
112 (write-read-repeat r0 , cyrillic-koi8-r-encode-table))))))
113 "CCL program to encode KOI8.") 105 "CCL program to encode KOI8.")
114 106
115(make-coding-system 107(make-coding-system
@@ -131,21 +123,17 @@
131 123
132(define-ccl-program ccl-encode-koi8-font 124(define-ccl-program ccl-encode-koi8-font
133 `(0 125 `(0
134 ((r1 |= 128) 126 ((translate-character cyrillic-koi8-r-encode-table r0 r1)))
135 (r1 = r1 ,cyrillic-koi8-r-encode-table)))
136 "CCL program to encode Cyrillic chars to KOI font.") 127 "CCL program to encode Cyrillic chars to KOI font.")
137 128
138(setq font-ccl-encoder-alist 129(setq font-ccl-encoder-alist
139 (cons (cons "koi8" ccl-encode-koi8-font) font-ccl-encoder-alist)) 130 (cons '("koi8" . ccl-encode-koi8-font) font-ccl-encoder-alist))
140
141(defvar cyrillic-koi8-r-nonascii-translation-table
142 (make-translation-table-from-vector cyrillic-koi8-r-decode-table)
143 "Value of `nonascii-translation-table' in Cyrillic-KOI8 language environment..")
144 131
145(set-language-info-alist 132(set-language-info-alist
146 "Cyrillic-KOI8" `((charset cyrillic-iso8859-5) 133 "Cyrillic-KOI8" `((charset cyrillic-iso8859-5)
147 (nonascii-translation 134 (nonascii-translation
148 . ,cyrillic-koi8-r-nonascii-translation-table) 135 . ,(get 'cyrillic-koi8-r-nonascii-translation-table
136 'translation-table))
149 (coding-system cyrillic-koi8) 137 (coding-system cyrillic-koi8)
150 (coding-priority cyrillic-koi8) 138 (coding-priority cyrillic-koi8)
151 (input-method . "cyrillic-jcuken") 139 (input-method . "cyrillic-jcuken")
@@ -157,8 +145,6 @@
157 145
158;;; ALTERNATIVNYJ staff 146;;; ALTERNATIVNYJ staff
159 147
160(eval-and-compile
161
162(defvar cyrillic-alternativnyj-decode-table 148(defvar cyrillic-alternativnyj-decode-table
163 [ 149 [
164 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 150 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
@@ -179,38 +165,34 @@
179 ?,L!(B ?,Lq(B 242 243 244 245 246 247 248 249 250 251 252 253 254 ?,Lp(B] 165 ?,L!(B ?,Lq(B 242 243 244 245 246 247 248 249 250 251 252 253 254 ?,Lp(B]
180 "Cyrillic ALTERNATIVNYJ decoding table.") 166 "Cyrillic ALTERNATIVNYJ decoding table.")
181 167
182(defvar cyrillic-alternativnyj-encode-table 168(let ((table (make-translation-table-from-vector
183 (let ((table (make-vector 256 32)) 169 cyrillic-alternativnyj-decode-table)))
184 (i 0)) 170 (define-translation-table 'cyrillic-alternativnyj-nonascii-translation-table
185 (while (< i 256)
186 (let* ((ch (aref cyrillic-alternativnyj-decode-table i))
187 (split (split-char ch)))
188 (if (eq (car split) 'cyrillic-iso8859-5)
189 (aset table (logior (nth 1 split) 128) i)
190 (if (/= ch 32)
191 (aset table ch i))))
192 (setq i (1+ i)))
193 table) 171 table)
194 "Cyrillic ALTERNATIVNYJ encoding table.") 172 (define-translation-table 'cyrillic-alternativnyj-encode-table
195 173 (char-table-extra-slot table 0)))
196)
197 174
198 175
199(define-ccl-program ccl-decode-alternativnyj 176(define-ccl-program ccl-decode-alternativnyj
200 `(3 177 `(3
201 ((read r0) 178 ((loop
202 (loop 179 (r0 = 0)
203 (write-read-repeat r0 ,cyrillic-alternativnyj-decode-table)))) 180 (read r1)
181 (if (r1 < 128)
182 (write-repeat r1)
183 ((translate-character cyrillic-alternativnyj-nonascii-translation-table
184 r0 r1)
185 (write-multibyte-character r0 r1)
186 (repeat))))))
204 "CCL program to decode Alternativnyj.") 187 "CCL program to decode Alternativnyj.")
205 188
206(define-ccl-program ccl-encode-alternativnyj 189(define-ccl-program ccl-encode-alternativnyj
207 `(1 190 `(1
208 ((read r0) 191 ((loop
209 (loop 192 (read-multibyte-character r0 r1)
210 (if (r0 != ,(charset-id 'cyrillic-iso8859-5)) 193 (if (r0 == ,(charset-id 'cyrillic-iso8859-5))
211 (write-read-repeat r0) 194 (translate-character cyrillic-alternativnyj-encode-table r0 r1))
212 ((read r0) 195 (write-repeat r1))))
213 (write-read-repeat r0 ,cyrillic-alternativnyj-encode-table))))))
214 "CCL program to encode Alternativnyj.") 196 "CCL program to encode Alternativnyj.")
215 197
216(make-coding-system 198(make-coding-system
@@ -227,22 +209,18 @@
227 209
228(define-ccl-program ccl-encode-alternativnyj-font 210(define-ccl-program ccl-encode-alternativnyj-font
229 '(0 211 '(0
230 ((r1 |= 128) 212 ((translate-character cyrillic-alternativnyj-encode-table r0 r1)))
231 (r1 = r1 ,cyrillic-alternativnyj-encode-table)))
232 "CCL program to encode Cyrillic chars to Alternativnyj font.") 213 "CCL program to encode Cyrillic chars to Alternativnyj font.")
233 214
234(setq font-ccl-encoder-alist 215(setq font-ccl-encoder-alist
235 (cons (cons "alternativnyj" ccl-encode-alternativnyj-font) 216 (cons '("alternativnyj" . ccl-encode-alternativnyj-font)
236 font-ccl-encoder-alist)) 217 font-ccl-encoder-alist))
237 218
238(defvar cyrillic-alternativnyj-nonascii-translation-table
239 (make-translation-table-from-vector cyrillic-alternativnyj-decode-table)
240 "Value of `nonascii-translation-table' in Cyrillic-ALT language environment.")
241
242(set-language-info-alist 219(set-language-info-alist
243 "Cyrillic-ALT" `((charset cyrillic-iso8859-5) 220 "Cyrillic-ALT" `((charset cyrillic-iso8859-5)
244 (nonascii-translation 221 (nonascii-translation
245 . ,cyrillic-alternativnyj-nonascii-translation-table) 222 . ,(get 'cyrillic-alternativnyj-nonascii-translation-table
223 'translation-table))
246 (coding-system cyrillic-alternativnyj) 224 (coding-system cyrillic-alternativnyj)
247 (coding-priority cyrillic-alternativnyj) 225 (coding-priority cyrillic-alternativnyj)
248 (input-method . "cyrillic-jcuken") 226 (input-method . "cyrillic-jcuken")