Mercurial > emacs
annotate lisp/language/cyrillic.el @ 62846:93362151dd3a
remove extraneous calls to shell-quote-argument
author | Karl Berry <karl@gnu.org> |
---|---|
date | Sat, 28 May 2005 16:57:21 +0000 |
parents | cd4d7a8ee284 |
children | 18a818a2ee7c |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37112
diff
changeset
|
1 ;;; cyrillic.el --- support for Cyrillic -*- coding: iso-2022-7bit; -*- |
17052 | 2 |
62396 | 3 ;; Copyright (C) 1997, 1998, 2001, 2002, 2003 Free Software Foundation, Inc. |
4 ;; Copyright (C) 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004 | |
5 ;; National Institute of Advanced Industrial Science and Technology (AIST) | |
6 ;; Registration Number H14PRO021 | |
17052 | 7 |
46500 | 8 ;; Author: Kenichi Handa <handa@etl.go.jp> |
9 ;; Keywords: multilingual, Cyrillic, i18n | |
17052 | 10 |
11 ;; This file is part of GNU Emacs. | |
12 | |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
14 ;; it under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
17071 | 24 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
26 ;; Boston, MA 02111-1307, USA. | |
17052 | 27 |
28 ;;; Commentary: | |
29 | |
46500 | 30 ;; The character set ISO8859-5 is supported. KOI-8 and ALTERNATIVNYJ |
31 ;; are converted to Unicode internally. See | |
32 ;; <URL:http://www.ecma.ch/ecma1/STAND/ECMA-113.HTM>. For more info | |
33 ;; on Cyrillic charsets, see | |
34 ;; <URL:http://czyborra.com/charsets/cyrillic.html>. The KOI and | |
35 ;; Alternativnyj coding systems should live in code-pages.el, but | |
36 ;; they've always been preloaded and the coding system autoload | |
37 ;; mechanism didn't get accepted, so they have to stay here and | |
38 ;; duplicate code-pages stuff. | |
39 | |
40 ;; Note that 8859-5 maps directly onto the Unicode Cyrillic block, | |
41 ;; apart from codepoints 160 (NBSP, c.f. U+0400), 173 (soft hyphen, | |
42 ;; c.f. U+04OD) and 253 (section sign, c.f U+045D). The KOI-8 and | |
43 ;; Alternativnyj coding systems encode both 8859-5 and Unicode. | |
44 ;; ucs-tables.el provides unification for cyrillic-iso-8bit. | |
45 | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
46 ;; Customizing `utf-fragment-on-decoding' allows decoding characters |
46500 | 47 ;; from KOI and Alternativnyj into 8859-5 where that's possible. |
48 ;; cyrillic-iso8859-5 characters take half as much space in the buffer | |
49 ;; as the mule-unicode-0100-24ff equivalents, though that's probably | |
50 ;; not normally a big deal. | |
17052 | 51 |
52 ;;; Code: | |
53 | |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
54 ;; Cyrillic (general) |
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
55 |
46500 | 56 ;; ISO-8859-5 stuff |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
57 |
17052 | 58 (make-coding-system |
18308 | 59 'cyrillic-iso-8bit 2 ?5 |
42152 | 60 "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)." |
20745 | 61 '(ascii cyrillic-iso8859-5 nil nil |
48387
4cafb19f6c46
(cyrillic-iso-8bit): Make it safe.
Kenichi Handa <handa@m17n.org>
parents:
48158
diff
changeset
|
62 nil nil nil nil nil nil nil nil nil nil nil t) |
20745 | 63 '((safe-charsets ascii cyrillic-iso8859-5) |
64 (mime-charset . iso-8859-5))) | |
17052 | 65 |
18520
383d11185239
Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18454
diff
changeset
|
66 (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit) |
18308 | 67 |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
68 (set-language-info-alist |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
69 "Cyrillic-ISO" '((charset cyrillic-iso8859-5) |
20745 | 70 (coding-system cyrillic-iso-8bit) |
71 (coding-priority cyrillic-iso-8bit) | |
46500 | 72 (input-method . "cyrillic-yawerty") ; fixme |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
73 (nonascii-translation . cyrillic-iso8859-5) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
74 (unibyte-display . cyrillic-iso-8bit) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
75 (features cyril-util) |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
76 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") |
20745 | 77 (documentation . "Support for Cyrillic ISO-8859-5.")) |
78 '("Cyrillic")) | |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
79 |
46500 | 80 ;; KOI-8R stuff |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
81 |
46500 | 82 ;; The mule-unicode portion of this is from |
83 ;; http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT, | |
84 ;; which references RFC 1489. | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
85 (defvar cyrillic-koi8-r-decode-table |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
86 [ |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
87 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
88 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
89 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
90 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
91 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
92 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
93 96 97 98 99 100 101 102 103 104 105 106 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?$,1(k(B ?$,1(W(B ?$,1(h(B ?$,1(m(B ?$,1(i(B ?$,1(g(B ?$,1(j(B | |
111 ;; ?$,1(N(B ?$,1(0(B ?$,1(1(B ?$,1(F(B ?$,1(4(B ?$,1(5(B ?$,1(D(B ?$,1(3(B ?$,1(E(B ?$,1(8(B ?$,1(9(B ?$,1(:(B ?$,1(;(B ?$,1(<(B ?$,1(=(B ?$,1(>(B | |
112 ;; ?$,1(?(B ?$,1(O(B ?$,1(@(B ?$,1(A(B ?$,1(B(B ?$,1(C(B ?$,1(6(B ?$,1(2(B ?$,1(L(B ?$,1(K(B ?$,1(7(B ?$,1(H(B ?$,1(M(B ?$,1(I(B ?$,1(G(B ?$,1(J(B | |
113 ] | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
114 "Cyrillic KOI8-R decoding table.") |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
115 |
29453 | 116 (let ((table (make-translation-table-from-vector |
117 cyrillic-koi8-r-decode-table))) | |
118 (define-translation-table 'cyrillic-koi8-r-nonascii-translation-table table) | |
119 (define-translation-table 'cyrillic-koi8-r-encode-table | |
120 (char-table-extra-slot table 0))) | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
121 |
46500 | 122 ;; No point in keeping it around. (It can't be let-bound, since it's |
123 ;; needed for macro expansion.) | |
124 (makunbound 'cyrillic-koi8-r-decode-table) | |
125 | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
126 (define-ccl-program ccl-decode-koi8 |
46500 | 127 `(4 |
29453 | 128 ((loop |
129 (r0 = 0) | |
130 (read r1) | |
131 (if (r1 < 128) | |
132 (write-repeat r1) | |
133 ((translate-character cyrillic-koi8-r-nonascii-translation-table r0 r1) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
134 (translate-character ucs-translation-table-for-decode r0 r1) |
29453 | 135 (write-multibyte-character r0 r1) |
136 (repeat)))))) | |
46500 | 137 "CCL program to decode KOI8-R.") |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
138 |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
139 (define-ccl-program ccl-encode-koi8 |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
140 `(1 |
29453 | 141 ((loop |
142 (read-multibyte-character r0 r1) | |
46500 | 143 (translate-character cyrillic-koi8-r-encode-table r0 r1) |
48832
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
144 (if (r0 != ,(charset-id 'ascii)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
145 (if (r0 != ,(charset-id 'eight-bit-graphic)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
146 (if (r0 != ,(charset-id 'eight-bit-control)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
147 (r1 = ??)))) |
29453 | 148 (write-repeat r1)))) |
46500 | 149 "CCL program to encode KOI8-R.") |
150 | |
151 (defun cyrillic-unify-encoding (table) | |
152 "Set up equivalent characters in the encoding TABLE. | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
153 This works whether or not the table is Unicode-based or |
46500 | 154 8859-5-based. (Only appropriate for Cyrillic.)" |
155 (let ((table (get table 'translation-table))) | |
156 (dotimes (i 96) | |
157 (let* ((c (make-char 'cyrillic-iso8859-5 (+ i 32))) | |
158 (u ; equivalent Unicode char | |
159 (cond ((eq c ?,L (B) ?,A (B) | |
160 ((eq c ?,L-(B) ?,A-(B) | |
161 ((eq c ?,L}(B) ?,A'(B) | |
162 (t (decode-char 'ucs (+ #x400 i))))) | |
163 (ec (aref table c)) ; encoding of 8859-5 | |
164 (uc (aref table u))) ; encoding of Unicode | |
165 (unless (memq c '(?,L (B ?,L-(B ?,L}(B)) ; 8859-5 exceptions | |
166 (unless uc | |
167 (aset table u ec)) | |
168 (unless ec | |
169 (aset table c uc))))))) | |
170 | |
171 (cyrillic-unify-encoding 'cyrillic-koi8-r-encode-table) | |
172 | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
173 (make-coding-system |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
18155
diff
changeset
|
174 'cyrillic-koi8 4 |
18116
7839aa2f6765
(koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents:
17993
diff
changeset
|
175 ;; We used to use ?K. It is true that ?K is more strictly correct, |
7839aa2f6765
(koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents:
17993
diff
changeset
|
176 ;; but it is also used for Korean. |
7839aa2f6765
(koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents:
17993
diff
changeset
|
177 ;; So people who use koi8 for languages other than Russian |
7839aa2f6765
(koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents:
17993
diff
changeset
|
178 ;; will have to forgive us. |
46500 | 179 ?R "KOI8-R 8-bit encoding for Cyrillic (MIME: KOI8-R)." |
21663
a03ddc4a728b
FLAGS arguments for make-coding-system changed.
Kenichi Handa <handa@m17n.org>
parents:
20745
diff
changeset
|
180 '(ccl-decode-koi8 . ccl-encode-koi8) |
46500 | 181 `((safe-chars . cyrillic-koi8-r-encode-table) |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
182 (mime-charset . koi8-r) |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
183 (valid-codes (0 . 255)) |
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
184 (dependency unify-8859-on-encoding-mode unify-8859-on-decoding-mode))) |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
185 |
18520
383d11185239
Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18454
diff
changeset
|
186 (define-coding-system-alias 'koi8-r 'cyrillic-koi8) |
383d11185239
Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18454
diff
changeset
|
187 (define-coding-system-alias 'koi8 'cyrillic-koi8) |
46500 | 188 (define-coding-system-alias 'cp878 'cyrillic-koi8) |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
189 |
56709 | 190 (let ((elt `("koi8-r" koi8-r 1 |
191 ,(get 'cyrillic-koi8-r-encode-table 'translation-table))) | |
192 (slot (assoc "koi8-r" ctext-non-standard-encodings-alist))) | |
193 (if slot | |
194 (setcdr slot (cdr elt)) | |
195 (push elt ctext-non-standard-encodings-alist))) | |
196 | |
46500 | 197 ;; Allow displaying some of KOI & al with an 8859-5-encoded font. We |
198 ;; won't bother about the exceptions when encoding the font, since | |
199 ;; NBSP will fall through below and work anyhow, and we'll have | |
200 ;; avoided setting the fontset for the other two to 8859-5 -- they're | |
201 ;; not in KOI and Alternativnyj anyhow. | |
202 (define-ccl-program ccl-encode-8859-5-font | |
203 `(0 | |
204 ((if (r0 == ,(charset-id 'cyrillic-iso8859-5)) | |
205 (r1 += 128) | |
206 (if (r0 == ,(charset-id 'mule-unicode-0100-24ff)) | |
207 (r1 = (r2 + 128)))))) | |
208 "Encode ISO 8859-5 and Cyrillic Unicode chars to 8859-5 font.") | |
209 | |
210 (add-to-list 'font-ccl-encoder-alist '("iso8859-5" . ccl-encode-8859-5-font)) | |
211 | |
212 ;; The table is set up later to encode both Unicode and 8859-5. | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
213 (define-ccl-program ccl-encode-koi8-font |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
214 `(0 |
53356
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
215 (if (r2 >= 0) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
216 ((r1 <<= 7) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
217 (r1 += r2))) |
46500 | 218 (translate-character cyrillic-koi8-r-encode-table r0 r1)) |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
219 "CCL program to encode Cyrillic chars to KOI font.") |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
220 |
46500 | 221 (add-to-list 'font-ccl-encoder-alist '("koi8" . ccl-encode-koi8-font)) |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
222 |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
223 (set-language-info-alist |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
224 "Cyrillic-KOI8" `((charset cyrillic-iso8859-5) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
225 (nonascii-translation |
29453 | 226 . ,(get 'cyrillic-koi8-r-nonascii-translation-table |
227 'translation-table)) | |
20745 | 228 (coding-system cyrillic-koi8) |
46500 | 229 (coding-priority cyrillic-koi8 cyrillic-iso-8bit) |
56710
e6d92cac8e9b
("Cyrillic-KOI8"): Fix typo.
Kenichi Handa <handa@m17n.org>
parents:
56709
diff
changeset
|
230 (ctext-non-standard-encodings "koi8-r") |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
231 (input-method . "russian-typewriter") |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
232 (features cyril-util) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
233 (unibyte-display . cyrillic-koi8) |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
234 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
235 (documentation . "Support for Cyrillic KOI8-R.")) |
20745 | 236 '("Cyrillic")) |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
237 |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
238 (set-language-info-alist |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
239 "Russian" `((charset cyrillic-iso8859-5) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
240 (nonascii-translation |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
241 . ,(get 'cyrillic-koi8-r-nonascii-translation-table |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
242 'translation-table)) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
243 (coding-system cyrillic-koi8) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
244 (coding-priority cyrillic-koi8 cyrillic-iso-8bit) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
245 (input-method . "russian-computer") |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
246 (features cyril-util) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
247 (unibyte-display . cyrillic-koi8) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
248 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
249 (documentation . "\ |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
250 Support for Russian using koi8-r and the russian-computer input method.") |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
251 (tutorial . "TUTORIAL.ru")) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
252 '("Cyrillic")) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
253 |
46500 | 254 |
255 (defvar cyrillic-koi8-u-decode-table | |
256 [ | |
257 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
258 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
259 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
260 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
261 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
262 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
263 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
264 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
265 ;; All Unicode: | |
266 ;; ?$,2 (B ?$,2 "(B ?$,2 ,(B ?$,2 0(B ?$,2 4(B ?$,2 8(B ?$,2 <(B ?$,2 D(B ?$,2 L(B ?$,2 T(B ?$,2 \(B ?$,2!@(B ?$,2!D(B ?$,2!H(B ?$,2!L(B ?$,2!P(B | |
267 ;; ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,1{ (B ?$,2!`(B ?$,1x9(B ?$,1x:(B ?$,1xh(B ?$,1y$(B ?$,1y%(B ?,L (B ?$,1{!(B ?,A0(B ?,A2(B ?,A7(B ?,Aw(B | |
268 ;; ?$,2 p(B ?$,2 q(B ?$,2 r(B ?$,1(q(B ?$,1(t(B ?$,2 t(B ?$,1(v(B ?$,1(w(B ?$,2 w(B ?$,2 x(B ?$,2 y(B ?$,2 z(B ?$,2 {(B ?$,1)Q(B ?$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$(B ?$,1y%(B ?,L (B ?$,1{!(B ?,A0(B ?,A2(B ?,A7(B ?,Aw(B | |
277 ?$,2 p(B ?$,2 q(B ?$,2 r(B ?,Lq(B ?,Lt(B ?$,2 t(B ?,Lv(B ?,Lw(B ?$,2 w(B ?$,2 x(B ?$,2 y(B ?$,2 z(B ?$,2 {(B ?$,1)Q(B ?$,2 }(B ?$,2 ~(B | |
278 ?$,2 (B ?$,2! (B ?$,2!!(B ?,L!(B ?,L$(B ?$,2!#(B ?,L&(B ?,L'(B ?$,2!&(B ?$,2!'(B ?$,2!((B ?$,2!)(B ?$,2!*(B ?$,1)P(B ?$,2!,(B ?,A)(B | |
279 ?,Ln(B ?,LP(B ?,LQ(B ?,Lf(B ?,LT(B ?,LU(B ?,Ld(B ?,LS(B ?,Le(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B | |
280 ?,L_(B ?,Lo(B ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,LV(B ?,LR(B ?,Ll(B ?,Lk(B ?,LW(B ?,Lh(B ?,Lm(B ?,Li(B ?,Lg(B ?,Lj(B | |
281 ?,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 | |
282 ?,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 | |
283 ] | |
284 "Cyrillic KOI8-U decoding table.") | |
285 | |
286 (let ((table (make-translation-table-from-vector | |
287 cyrillic-koi8-u-decode-table))) | |
288 (define-translation-table 'cyrillic-koi8-u-nonascii-translation-table table) | |
289 (define-translation-table 'cyrillic-koi8-u-encode-table | |
290 (char-table-extra-slot table 0))) | |
291 | |
292 (makunbound 'cyrillic-koi8-u-decode-table) | |
293 | |
294 (define-ccl-program ccl-decode-koi8-u | |
295 `(4 | |
296 ((loop | |
297 (r0 = 0) | |
298 (read r1) | |
299 (if (r1 < 128) | |
300 (write-repeat r1) | |
301 ((translate-character cyrillic-koi8-u-nonascii-translation-table r0 r1) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
302 (translate-character ucs-translation-table-for-decode r0 r1) |
46500 | 303 (write-multibyte-character r0 r1) |
304 (repeat)))))) | |
305 "CCL program to decode KOI8-U.") | |
306 | |
307 (define-ccl-program ccl-encode-koi8-u | |
308 `(1 | |
309 ((loop | |
310 (read-multibyte-character r0 r1) | |
311 (translate-character cyrillic-koi8-u-encode-table r0 r1) | |
48832
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
312 (if (r0 != ,(charset-id 'ascii)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
313 (if (r0 != ,(charset-id 'eight-bit-graphic)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
314 (if (r0 != ,(charset-id 'eight-bit-control)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
315 (r1 = ??)))) |
46500 | 316 (write-repeat r1)))) |
317 "CCL program to encode KOI8-U.") | |
318 | |
319 (cyrillic-unify-encoding 'cyrillic-koi8-u-encode-table) | |
320 | |
321 (make-coding-system | |
322 'koi8-u 4 | |
323 ?U "KOI8-U 8-bit encoding for Cyrillic (MIME: KOI8-U)" | |
324 '(ccl-decode-koi8-u . ccl-encode-koi8-u) | |
325 `((safe-chars . cyrillic-koi8-u-encode-table) | |
326 (mime-charset . koi8-u) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
327 (valid-codes (0 . 255)) |
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
328 (dependency unify-8859-on-encoding-mode unify-8859-on-decoding-mode))) |
46500 | 329 |
330 (define-ccl-program ccl-encode-koi8-u-font | |
331 `(0 | |
332 (translate-character cyrillic-koi8-u-encode-table r0 r1)) | |
333 "CCL program to encode Cyrillic chars to KOI-U font.") | |
334 | |
335 (add-to-list 'font-ccl-encoder-alist '("koi8-u" . ccl-encode-koi8-u-font)) | |
336 | |
337 (set-language-info-alist | |
338 "Ukrainian" `((coding-system koi8-u) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
339 (coding-priority koi8-u) |
46500 | 340 (nonascii-translation |
47416
2ff3f5116672
("Ukrainian"): Fix nonascii-translation.
Dave Love <fx@gnu.org>
parents:
46500
diff
changeset
|
341 . ,(get 'cyrillic-koi8-u-nonascii-translation-table |
46500 | 342 'translation-table)) |
343 (input-method . "ukrainian-computer") | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
344 (documentation |
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
345 . "Support for Ukrainian with KOI8-U character set.")) |
46500 | 346 '("Cyrillic")) |
347 | |
348 ;;; ALTERNATIVNYJ stuff | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
349 |
47416
2ff3f5116672
("Ukrainian"): Fix nonascii-translation.
Dave Love <fx@gnu.org>
parents:
46500
diff
changeset
|
350 ;; Fixme: It's unclear what's the correct table. I've found |
2ff3f5116672
("Ukrainian"): Fix nonascii-translation.
Dave Love <fx@gnu.org>
parents:
46500
diff
changeset
|
351 ;; statements both that it's the same as cp866 and somewhat different, |
47906
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
352 ;; but nothing that looks really definitive. |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
353 (defvar cyrillic-alternativnyj-decode-table |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
354 [ |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
355 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
356 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
357 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
358 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
359 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
360 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
361 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
e0e17bbd8e6c
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,1(a(B ?$,1(b(B ?$,1(c(B ?$,1(d(B ?$,1(e(B ?$,1(f(B ?$,1(g(B ?$,1(h(B ?$,1(i(B ?$,1(j(B ?$,1(k(B ?$,1(l(B ?$,1(m(B ?$,1(n(B ?$,1(o(B | |
47906
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
370 ;; ?$,1(!(B ?$,1(q(B ?$,1ry(B ?$,1rx(B ?$,1%A(B ?$,1%@(B ?$,1s:(B ?$,1s9(B ?$,1vq(B ?$,1vs(B ?,A1(B ?,Aw(B ?$,1uV(B ?,A$(B ?$,2!`(B ?,A (B ; |
46500 | 371 ;; 8859+Unicode |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
372 ?,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 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
373 ?,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 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
374 ?,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 |
46500 | 375 ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,2 "(B ?$,2 D(B ?$,2!!(B ?$,2!"(B ?$,2 v(B ?$,2 u(B ?$,2!#(B ?$,2 q(B ?$,2 w(B ?$,2 }(B ?$,2 |(B ?$,2 {(B ?$,2 0(B |
376 ?$,2 4(B ?$,2 T(B ?$,2 L(B ?$,2 <(B ?$,2 (B ?$,2 \(B ?$,2 ~(B ?$,2 (B ?$,2 z(B ?$,2 t(B ?$,2!)(B ?$,2!&(B ?$,2! (B ?$,2 p(B ?$,2!,(B ?$,2!'(B | |
377 ?$,2!((B ?$,2!$(B ?$,2!%(B ?$,2 y(B ?$,2 x(B ?$,2 r(B ?$,2 s(B ?$,2!+(B ?$,2!*(B ?$,2 8(B ?$,2 ,(B ?$,2!H(B ?$,2!D(B ?$,2!L(B ?$,2!P(B ?$,2!@(B | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
378 ?,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 |
47906
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
379 ;; Taken from http://www.cyrillic.com/ref/cyrillic/koi-8alt.html |
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
380 ;; with guesses for the Unicodes of the glyphs in the absence of a |
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
381 ;; table. |
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
382 ?,L!(B ?,Lq(B ?$,1ry(B ?$,1rx(B ?$,1%A(B ?$,1%@(B ?$,1s:(B ?$,1s9(B ?$,1vq(B ?$,1vs(B ?,A1(B ?,Aw(B ?,Lp(B ?,A$(B ?$,2!`(B ?,L (B] |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
383 "Cyrillic ALTERNATIVNYJ decoding table.") |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
384 |
29453 | 385 (let ((table (make-translation-table-from-vector |
386 cyrillic-alternativnyj-decode-table))) | |
387 (define-translation-table 'cyrillic-alternativnyj-nonascii-translation-table | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
388 table) |
29453 | 389 (define-translation-table 'cyrillic-alternativnyj-encode-table |
390 (char-table-extra-slot table 0))) | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
391 |
46500 | 392 (makunbound 'cyrillic-alternativnyj-decode-table) |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
393 |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
394 (define-ccl-program ccl-decode-alternativnyj |
46500 | 395 `(4 |
29453 | 396 ((loop |
397 (r0 = 0) | |
398 (read r1) | |
399 (if (r1 < 128) | |
400 (write-repeat r1) | |
401 ((translate-character cyrillic-alternativnyj-nonascii-translation-table | |
402 r0 r1) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
403 (translate-character ucs-translation-table-for-decode r0 r1) |
29453 | 404 (write-multibyte-character r0 r1) |
405 (repeat)))))) | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
406 "CCL program to decode Alternativnyj.") |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
407 |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
408 (define-ccl-program ccl-encode-alternativnyj |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
409 `(1 |
29453 | 410 ((loop |
411 (read-multibyte-character r0 r1) | |
30495
491e0864dd18
(cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents:
29453
diff
changeset
|
412 (translate-character cyrillic-alternativnyj-encode-table r0 r1) |
48832
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
413 (if (r0 != ,(charset-id 'ascii)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
414 (if (r0 != ,(charset-id 'eight-bit-graphic)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
415 (if (r0 != ,(charset-id 'eight-bit-control)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
416 (r1 = ??)))) |
29453 | 417 (write-repeat r1)))) |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
418 "CCL program to encode Alternativnyj.") |
46500 | 419 |
420 (cyrillic-unify-encoding 'cyrillic-alternativnyj-encode-table) | |
421 | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
422 (make-coding-system |
18308 | 423 'cyrillic-alternativnyj 4 ?A |
47906
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
424 "ALTERNATIVNYJ 8-bit encoding for Cyrillic." |
21663
a03ddc4a728b
FLAGS arguments for make-coding-system changed.
Kenichi Handa <handa@m17n.org>
parents:
20745
diff
changeset
|
425 '(ccl-decode-alternativnyj . ccl-encode-alternativnyj) |
46500 | 426 `((safe-chars . cyrillic-alternativnyj-encode-table) |
427 (valid-codes (0 . 255)) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
428 (dependency unify-8859-on-encoding-mode unify-8859-on-decoding-mode))) |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
429 |
18520
383d11185239
Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18454
diff
changeset
|
430 (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj) |
18308 | 431 |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
432 (define-ccl-program ccl-encode-alternativnyj-font |
46500 | 433 `(0 |
434 (translate-character cyrillic-alternativnyj-encode-table r0 r1)) | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
435 "CCL program to encode Cyrillic chars to Alternativnyj font.") |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
436 |
46500 | 437 (add-to-list 'font-ccl-encoder-alist |
438 '("alternativnyj" . ccl-encode-alternativnyj-font)) | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
439 |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17841
diff
changeset
|
440 (set-language-info-alist |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
441 "Cyrillic-ALT" `((charset cyrillic-iso8859-5) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
442 (nonascii-translation |
29453 | 443 . ,(get 'cyrillic-alternativnyj-nonascii-translation-table |
444 'translation-table)) | |
20745 | 445 (coding-system cyrillic-alternativnyj) |
446 (coding-priority cyrillic-alternativnyj) | |
46500 | 447 (input-method . "russian-typewriter") |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
448 (features cyril-util) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
449 (unibyte-display . cyrillic-alternativnyj) |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
450 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") |
20745 | 451 (documentation . "Support for Cyrillic ALTERNATIVNYJ.")) |
452 '("Cyrillic")) | |
17052 | 453 |
46500 | 454 (set-language-info-alist |
455 "Tajik" `((coding-system cyrillic-koi8-t) | |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
456 (coding-priority cyrillic-koi8-t) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
457 (nonascii-translation |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
458 . ,(get 'decode-koi8-t 'translation-table)) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
459 (input-method . "russian-typewriter") ; fixme? |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
460 (features code-pages) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
461 (documentation . "Support for Tajik using KOI8-T.")) |
46500 | 462 '("Cyrillic")) |
463 | |
52437 | 464 (eval-and-compile |
465 (setq | |
466 non-iso-charset-alist | |
467 (cp-make-coding-system | |
468 windows-1251 | |
469 [?\$,1("(B ?\$,1(#(B ?\$,1rz(B ?\$,1(s(B ?\$,1r~(B ?\$,1s&(B ?\$,1s (B ?\$,1s!(B ?\$,1tL(B ?\$,1s0(B ?\$,1()(B ?\$,1s9(B ?\$,1(*(B ?\$,1(,(B ?\$,1(+(B ?\$,1(/(B ?\$,1(r(B | |
470 ?\$,1rx(B ?\$,1ry(B ?\$,1r|(B ?\$,1r}(B ?\$,1s"(B ?\$,1rs(B ?\$,1rt(B nil ?\$,1ub(B ?\$,1(y(B ?\$,1s:(B ?\$,1(z(B ?\$,1(|(B ?\$,1({(B ?\$,1((B ?\,A (B ?\$,1(.(B | |
471 ?\$,1(~(B ?\$,1(((B ?\,A$(B ?\$,1)P(B ?\,A&(B ?\,A'(B ?\$,1(!(B ?\,A)(B ?\$,1($(B ?\,A+(B ?\,A,(B ?\,A-(B ?\,A.(B ?\$,1('(B ?\,A0(B ?\,A1(B ?\$,1(&(B | |
472 ?\$,1(v(B ?\$,1)Q(B ?\,A5(B ?\,A6(B ?\,A7(B ?\$,1(q(B ?\$,1uV(B ?\$,1(t(B ?\,A;(B ?\$,1(x(B ?\$,1(%(B ?\$,1(u(B ?\$,1(w(B ?\$,1(0(B ?\$,1(1(B ?\$,1(2(B ?\$,1(3(B | |
473 ?\$,1(4(B ?\$,1(5(B ?\$,1(6(B ?\$,1(7(B ?\$,1(8(B ?\$,1(9(B ?\$,1(:(B ?\$,1(;(B ?\$,1(<(B ?\$,1(=(B ?\$,1(>(B ?\$,1(?(B ?\$,1(@(B ?\$,1(A(B ?\$,1(B(B ?\$,1(C(B ?\$,1(D(B | |
474 ?\$,1(E(B ?\$,1(F(B ?\$,1(G(B ?\$,1(H(B ?\$,1(I(B ?\$,1(J(B ?\$,1(K(B ?\$,1(L(B ?\$,1(M(B ?\$,1(N(B ?\$,1(O(B ?\$,1(P(B ?\$,1(Q(B ?\$,1(R(B ?\$,1(S(B ?\$,1(T(B ?\$,1(U(B | |
475 ?\$,1(V(B ?\$,1(W(B ?\$,1(X(B ?\$,1(Y(B ?\$,1(Z(B ?\$,1([(B ?\$,1(\(B ?\$,1(](B ?\$,1(^(B ?\$,1(_(B ?\$,1(`(B ?\$,1(a(B ?\$,1(b(B ?\$,1(c(B ?\$,1(d(B ?\$,1(e(B ?\$,1(f(B | |
476 ?\$,1(g(B ?\$,1(h(B ?\$,1(i(B ?\$,1(j(B ?\$,1(k(B ?\$,1(l(B ?\$,1(m(B ?\$,1(n(B ?\$,1(o(B] nil ?b))) | |
477 | |
62797
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
478 ;; Register cyrillic-iso8859-5 characters in the encode table of |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
479 ;; windows-1251. |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
480 (let ((table (get 'encode-windows-1251 'translation-table)) |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
481 ;; Nth element is a cyrillic-iso8859-5 character encoded to a |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
482 ;; code (128 + N), or nil. |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
483 (vec [?\,L"(B ?\,L#(B nil ?\,Ls(B nil nil nil nil nil nil ?\,L)(B nil ?\,L*(B ?\,L,(B ?\,L+(B ?\,L/(B |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
484 ?\,Lr(B nil nil nil nil nil nil nil nil nil ?\,Ly(B nil ?\,Lz(B ?\,L|(B ?\,L{(B ?\,L(B |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
485 nil ?\,L.(B ?\,L~(B ?\,L((B nil nil nil nil ?\,L!(B nil ?\,L$(B nil nil nil nil ?\,L'(B |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
486 nil nil ?\,L&(B ?\,Lv(B nil nil nil nil ?\,Lq(B ?\,Lp(B ?\,Lt(B nil ?\,Lx(B ?\,L%(B ?\,Lu(B ?\,Lw(B |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
487 ?\,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 |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
488 ?\,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 |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
489 ?\,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 |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
490 ?\,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])) |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
491 (dotimes (i (length vec)) |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
492 (if (aref vec i) |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
493 (aset table (aref vec i) (+ 128 i))))) |
cd4d7a8ee284
Add cyrillic-iso8859-5 characters in the encoding table of
Kenichi Handa <handa@m17n.org>
parents:
62396
diff
changeset
|
494 |
52720 | 495 (define-coding-system-alias 'cp1251 'windows-1251) |
496 | |
53242
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
497 (let ((elt `("microsoft-cp1251" windows-1251 1 |
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
498 ,(get 'encode-windows-1251 'translation-table))) |
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
499 (slot (assoc "microsoft-cp1251" ctext-non-standard-encodings-alist))) |
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
500 (if slot |
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
501 (setcdr slot (cdr elt)) |
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
502 (push elt ctext-non-standard-encodings-alist))) |
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
503 |
53356
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
504 (define-ccl-program ccl-encode-windows-1251-font |
53672
e349592390bc
(ccl-encode-windows-1251-font): Rearrange
Kenichi Handa <handa@m17n.org>
parents:
53356
diff
changeset
|
505 `(0 |
e349592390bc
(ccl-encode-windows-1251-font): Rearrange
Kenichi Handa <handa@m17n.org>
parents:
53356
diff
changeset
|
506 ((if (r0 == ,(charset-id 'mule-unicode-0100-24ff)) |
e349592390bc
(ccl-encode-windows-1251-font): Rearrange
Kenichi Handa <handa@m17n.org>
parents:
53356
diff
changeset
|
507 ((r1 <<= 7) |
e349592390bc
(ccl-encode-windows-1251-font): Rearrange
Kenichi Handa <handa@m17n.org>
parents:
53356
diff
changeset
|
508 (r1 += r2))) |
e349592390bc
(ccl-encode-windows-1251-font): Rearrange
Kenichi Handa <handa@m17n.org>
parents:
53356
diff
changeset
|
509 (translate-character encode-windows-1251 r0 r1)))) |
53356
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
510 |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
511 (add-to-list 'font-ccl-encoder-alist |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
512 '("microsoft-cp1251" . ccl-encode-windows-1251-font)) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
513 |
46500 | 514 (set-language-info-alist |
515 "Bulgarian" `((coding-system windows-1251) | |
53242
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
516 (coding-priority windows-1251) |
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
517 (ctext-non-standard-encodings "microsoft-cp1251") |
53356
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
518 (overriding-fontspec |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
519 (,(get 'encode-windows-1251 'translation-table) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
520 . (nil . "microsoft-cp1251")) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
521 (,(get 'cyrillic-koi8-r-encode-table 'translation-table) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
522 . (nil . "koi8-r"))) |
46500 | 523 (nonascii-translation |
524 . ,(get 'decode-windows-1251 'translation-table)) | |
47906
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
525 (input-method . "bulgarian-bds") |
46500 | 526 (documentation |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
527 . "Support for Bulgarian with windows-1251 character set.") |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
528 (tutorial . "TUTORIAL.bg")) |
46500 | 529 '("Cyrillic")) |
530 | |
531 (set-language-info-alist | |
532 "Belarusian" `((coding-system windows-1251) | |
533 (coding-priority windows-1251) | |
53242
e8f42b49f71f
Register "microsoft-cp1251" in ctext-non-standard-encodings-alist.
Kenichi Handa <handa@m17n.org>
parents:
52720
diff
changeset
|
534 (ctext-non-standard-encodings "microsoft-cp1251") |
53356
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
535 (overriding-fontspec |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
536 (,(get 'encode-windows-1251 'translation-table) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
537 . (nil . "microsoft-cp1251")) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
538 (,(get 'cyrillic-koi8-r-encode-table 'translation-table) |
8e5d406a10a5
(ccl-encode-koi8-font): Make it work for
Kenichi Handa <handa@m17n.org>
parents:
53242
diff
changeset
|
539 . (nil . "koi8-r"))) |
46500 | 540 (nonascii-translation |
541 . ,(get 'decode-windows-1251 'translation-table)) | |
542 (input-method . "belarusian") | |
543 (documentation | |
544 . "Support for Belarusian with windows-1251 character set. | |
545 \(The name Belarusian replaced Byelorussian in the early 1990s.)")) | |
546 '("Cyrillic")) | |
547 | |
33778 | 548 (provide 'cyrillic) |
549 | |
52401 | 550 ;;; arch-tag: bda71ae0-ba41-4cb6-a6e0-1dff542313d3 |
17052 | 551 ;;; cyrillic.el ends here |