Mercurial > emacs
annotate lisp/language/cyrillic.el @ 52903:4330ac057822
(Font Selection): Remove obsolete info.
author | Dave Love <fx@gnu.org> |
---|---|
date | Tue, 21 Oct 2003 11:47:19 +0000 |
parents | b318ad3d41ce |
children | e8f42b49f71f |
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 |
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
18454
b44129078db3
Update copyright notice.
Richard M. Stallman <rms@gnu.org>
parents:
18308
diff
changeset
|
4 ;; Licensed to the Free Software Foundation. |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
5 ;; Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. |
17052 | 6 |
46500 | 7 ;; Author: Kenichi Handa <handa@etl.go.jp> |
8 ;; Keywords: multilingual, Cyrillic, i18n | |
17052 | 9 |
10 ;; This file is part of GNU Emacs. | |
11 | |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;; it under the terms of the GNU General Public License as published by | |
14 ;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;; any later version. | |
16 | |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
17071 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
25 ;; Boston, MA 02111-1307, USA. | |
17052 | 26 |
27 ;;; Commentary: | |
28 | |
46500 | 29 ;; The character set ISO8859-5 is supported. KOI-8 and ALTERNATIVNYJ |
30 ;; are converted to Unicode internally. See | |
31 ;; <URL:http://www.ecma.ch/ecma1/STAND/ECMA-113.HTM>. For more info | |
32 ;; on Cyrillic charsets, see | |
33 ;; <URL:http://czyborra.com/charsets/cyrillic.html>. The KOI and | |
34 ;; Alternativnyj coding systems should live in code-pages.el, but | |
35 ;; they've always been preloaded and the coding system autoload | |
36 ;; mechanism didn't get accepted, so they have to stay here and | |
37 ;; duplicate code-pages stuff. | |
38 | |
39 ;; Note that 8859-5 maps directly onto the Unicode Cyrillic block, | |
40 ;; apart from codepoints 160 (NBSP, c.f. U+0400), 173 (soft hyphen, | |
41 ;; c.f. U+04OD) and 253 (section sign, c.f U+045D). The KOI-8 and | |
42 ;; Alternativnyj coding systems encode both 8859-5 and Unicode. | |
43 ;; ucs-tables.el provides unification for cyrillic-iso-8bit. | |
44 | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
45 ;; Customizing `utf-fragment-on-decoding' allows decoding characters |
46500 | 46 ;; from KOI and Alternativnyj into 8859-5 where that's possible. |
47 ;; cyrillic-iso8859-5 characters take half as much space in the buffer | |
48 ;; as the mule-unicode-0100-24ff equivalents, though that's probably | |
49 ;; not normally a big deal. | |
17052 | 50 |
51 ;;; Code: | |
52 | |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
53 ;; Cyrillic (general) |
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
54 |
46500 | 55 ;; ISO-8859-5 stuff |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
56 |
17052 | 57 (make-coding-system |
18308 | 58 'cyrillic-iso-8bit 2 ?5 |
42152 | 59 "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)." |
20745 | 60 '(ascii cyrillic-iso8859-5 nil nil |
48387
4cafb19f6c46
(cyrillic-iso-8bit): Make it safe.
Kenichi Handa <handa@m17n.org>
parents:
48158
diff
changeset
|
61 nil nil nil nil nil nil nil nil nil nil nil t) |
20745 | 62 '((safe-charsets ascii cyrillic-iso8859-5) |
63 (mime-charset . iso-8859-5))) | |
17052 | 64 |
18520
383d11185239
Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18454
diff
changeset
|
65 (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit) |
18308 | 66 |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
67 (set-language-info-alist |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
68 "Cyrillic-ISO" '((charset cyrillic-iso8859-5) |
20745 | 69 (coding-system cyrillic-iso-8bit) |
70 (coding-priority cyrillic-iso-8bit) | |
46500 | 71 (input-method . "cyrillic-yawerty") ; fixme |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
72 (nonascii-translation . cyrillic-iso8859-5) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
73 (unibyte-display . cyrillic-iso-8bit) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
74 (features cyril-util) |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
75 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") |
20745 | 76 (documentation . "Support for Cyrillic ISO-8859-5.")) |
77 '("Cyrillic")) | |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
78 |
46500 | 79 ;; KOI-8R stuff |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
80 |
46500 | 81 ;; The mule-unicode portion of this is from |
82 ;; http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT, | |
83 ;; which references RFC 1489. | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
84 (defvar cyrillic-koi8-r-decode-table |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
85 [ |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
86 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
|
87 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
|
88 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
|
89 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
|
90 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
|
91 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
|
92 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
93 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
46500 | 94 ;; 8859-5 plus Unicode |
95 ?$,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 | |
96 ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,1{ (B ?$,2!`(B ?$,1s"(B ?$,1x:(B ?$,1xh(B ?$,1y$(B ?$,1y%(B ?,L (B ?$,1{!(B ?,A0(B ?,A2(B ?,A7(B ?,Aw(B | |
97 ?$,2 p(B ?$,2 q(B ?$,2 r(B ?,Lq(B ?$,2 s(B ?$,2 t(B ?$,2 u(B ?$,2 v(B ?$,2 w(B ?$,2 x(B ?$,2 y(B ?$,2 z(B ?$,2 {(B ?$,2 |(B ?$,2 }(B ?$,2 ~(B | |
98 ?$,2 (B ?$,2! (B ?$,2!!(B ?,L!(B ?$,2!"(B ?$,2!#(B ?$,2!$(B ?$,2!%(B ?$,2!&(B ?$,2!'(B ?$,2!((B ?$,2!)(B ?$,2!*(B ?$,2!+(B ?$,2!,(B ?,A)(B | |
99 ?,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 | |
100 ?,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(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?$,1(`(B ?$,1(a(B ?$,1(b(B ?$,1(c(B ?$,1(V(B ?$,1(R(B ?$,1(l(B ?$,1(k(B ?$,1(W(B ?$,1(h(B ?$,1(m(B ?$,1(i(B ?$,1(g(B ?$,1(j(B | |
110 ;; ?$,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 | |
111 ;; ?$,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 | |
112 ] | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
113 "Cyrillic KOI8-R decoding table.") |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
114 |
29453 | 115 (let ((table (make-translation-table-from-vector |
116 cyrillic-koi8-r-decode-table))) | |
117 (define-translation-table 'cyrillic-koi8-r-nonascii-translation-table table) | |
118 (define-translation-table 'cyrillic-koi8-r-encode-table | |
119 (char-table-extra-slot table 0))) | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
120 |
46500 | 121 ;; No point in keeping it around. (It can't be let-bound, since it's |
122 ;; needed for macro expansion.) | |
123 (makunbound 'cyrillic-koi8-r-decode-table) | |
124 | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
125 (define-ccl-program ccl-decode-koi8 |
46500 | 126 `(4 |
29453 | 127 ((loop |
128 (r0 = 0) | |
129 (read r1) | |
130 (if (r1 < 128) | |
131 (write-repeat r1) | |
132 ((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
|
133 (translate-character ucs-translation-table-for-decode r0 r1) |
29453 | 134 (write-multibyte-character r0 r1) |
135 (repeat)))))) | |
46500 | 136 "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
|
137 |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
138 (define-ccl-program ccl-encode-koi8 |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
139 `(1 |
29453 | 140 ((loop |
141 (read-multibyte-character r0 r1) | |
46500 | 142 (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
|
143 (if (r0 != ,(charset-id 'ascii)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
144 (if (r0 != ,(charset-id 'eight-bit-graphic)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
145 (if (r0 != ,(charset-id 'eight-bit-control)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
146 (r1 = ??)))) |
29453 | 147 (write-repeat r1)))) |
46500 | 148 "CCL program to encode KOI8-R.") |
149 | |
150 (defun cyrillic-unify-encoding (table) | |
151 "Set up equivalent characters in the encoding TABLE. | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
152 This works whether or not the table is Unicode-based or |
46500 | 153 8859-5-based. (Only appropriate for Cyrillic.)" |
154 (let ((table (get table 'translation-table))) | |
155 (dotimes (i 96) | |
156 (let* ((c (make-char 'cyrillic-iso8859-5 (+ i 32))) | |
157 (u ; equivalent Unicode char | |
158 (cond ((eq c ?,L (B) ?,A (B) | |
159 ((eq c ?,L-(B) ?,A-(B) | |
160 ((eq c ?,L}(B) ?,A'(B) | |
161 (t (decode-char 'ucs (+ #x400 i))))) | |
162 (ec (aref table c)) ; encoding of 8859-5 | |
163 (uc (aref table u))) ; encoding of Unicode | |
164 (unless (memq c '(?,L (B ?,L-(B ?,L}(B)) ; 8859-5 exceptions | |
165 (unless uc | |
166 (aset table u ec)) | |
167 (unless ec | |
168 (aset table c uc))))))) | |
169 | |
170 (cyrillic-unify-encoding 'cyrillic-koi8-r-encode-table) | |
171 | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
172 (make-coding-system |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
18155
diff
changeset
|
173 'cyrillic-koi8 4 |
18116
7839aa2f6765
(koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents:
17993
diff
changeset
|
174 ;; 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
|
175 ;; 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
|
176 ;; 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
|
177 ;; will have to forgive us. |
46500 | 178 ?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
|
179 '(ccl-decode-koi8 . ccl-encode-koi8) |
46500 | 180 `((safe-chars . cyrillic-koi8-r-encode-table) |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
181 (mime-charset . koi8-r) |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
182 (valid-codes (0 . 255)) |
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
183 (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
|
184 |
18520
383d11185239
Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18454
diff
changeset
|
185 (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
|
186 (define-coding-system-alias 'koi8 'cyrillic-koi8) |
46500 | 187 (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
|
188 |
46500 | 189 ;; Allow displaying some of KOI & al with an 8859-5-encoded font. We |
190 ;; won't bother about the exceptions when encoding the font, since | |
191 ;; NBSP will fall through below and work anyhow, and we'll have | |
192 ;; avoided setting the fontset for the other two to 8859-5 -- they're | |
193 ;; not in KOI and Alternativnyj anyhow. | |
194 (define-ccl-program ccl-encode-8859-5-font | |
195 `(0 | |
196 ((if (r0 == ,(charset-id 'cyrillic-iso8859-5)) | |
197 (r1 += 128) | |
198 (if (r0 == ,(charset-id 'mule-unicode-0100-24ff)) | |
199 (r1 = (r2 + 128)))))) | |
200 "Encode ISO 8859-5 and Cyrillic Unicode chars to 8859-5 font.") | |
201 | |
202 (add-to-list 'font-ccl-encoder-alist '("iso8859-5" . ccl-encode-8859-5-font)) | |
203 | |
204 ;; 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
|
205 (define-ccl-program ccl-encode-koi8-font |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
206 `(0 |
46500 | 207 (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
|
208 "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
|
209 |
46500 | 210 (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
|
211 |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
212 (set-language-info-alist |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
213 "Cyrillic-KOI8" `((charset cyrillic-iso8859-5) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
214 (nonascii-translation |
29453 | 215 . ,(get 'cyrillic-koi8-r-nonascii-translation-table |
216 'translation-table)) | |
20745 | 217 (coding-system cyrillic-koi8) |
46500 | 218 (coding-priority cyrillic-koi8 cyrillic-iso-8bit) |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
219 (input-method . "russian-typewriter") |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
220 (features cyril-util) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
221 (unibyte-display . cyrillic-koi8) |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
222 (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
|
223 (documentation . "Support for Cyrillic KOI8-R.")) |
20745 | 224 '("Cyrillic")) |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
225 |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
226 (set-language-info-alist |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
227 "Russian" `((charset cyrillic-iso8859-5) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
228 (nonascii-translation |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
229 . ,(get 'cyrillic-koi8-r-nonascii-translation-table |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
230 'translation-table)) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
231 (coding-system cyrillic-koi8) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
232 (coding-priority cyrillic-koi8 cyrillic-iso-8bit) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
233 (input-method . "russian-computer") |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
234 (features cyril-util) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
235 (unibyte-display . cyrillic-koi8) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
236 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
237 (documentation . "\ |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
238 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
|
239 (tutorial . "TUTORIAL.ru")) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
240 '("Cyrillic")) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
241 |
46500 | 242 |
243 (defvar cyrillic-koi8-u-decode-table | |
244 [ | |
245 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
246 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
247 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
248 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
249 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
250 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
251 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
252 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
253 ;; All Unicode: | |
254 ;; ?$,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 | |
255 ;; ?$,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 | |
256 ;; ?$,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 ?$,2 }(B ?$,2 ~(B | |
257 ;; ?$,2 (B ?$,2! (B ?$,2!!(B ?$,1(!(B ?$,1($(B ?$,2!#(B ?$,1(&(B ?$,1('(B ?$,2!&(B ?$,2!'(B ?$,2!((B ?$,2!)(B ?$,2!*(B ?$,1)P(B ?$,2!,(B ?,A)(B | |
258 ;; ?$,1(n(B ?$,1(P(B ?$,1(Q(B ?$,1(f(B ?$,1(T(B ?$,1(U(B ?$,1(d(B ?$,1(S(B ?$,1(e(B ?$,1(X(B ?$,1(Y(B ?$,1(Z(B ?$,1([(B ?$,1(\(B ?$,1(](B ?$,1(^(B | |
259 ;; ?$,1(_(B ?$,1(o(B ?$,1(`(B ?$,1(a(B ?$,1(b(B ?$,1(c(B ?$,1(V(B ?$,1(R(B ?$,1(l(B ?$,1(k(B ?$,1(W(B ?$,1(h(B ?$,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?,L[(B ?,L\(B ?,L](B ?,L^(B | |
268 ?,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 | |
269 ?,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 | |
270 ?,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 | |
271 ] | |
272 "Cyrillic KOI8-U decoding table.") | |
273 | |
274 (let ((table (make-translation-table-from-vector | |
275 cyrillic-koi8-u-decode-table))) | |
276 (define-translation-table 'cyrillic-koi8-u-nonascii-translation-table table) | |
277 (define-translation-table 'cyrillic-koi8-u-encode-table | |
278 (char-table-extra-slot table 0))) | |
279 | |
280 (makunbound 'cyrillic-koi8-u-decode-table) | |
281 | |
282 (define-ccl-program ccl-decode-koi8-u | |
283 `(4 | |
284 ((loop | |
285 (r0 = 0) | |
286 (read r1) | |
287 (if (r1 < 128) | |
288 (write-repeat r1) | |
289 ((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
|
290 (translate-character ucs-translation-table-for-decode r0 r1) |
46500 | 291 (write-multibyte-character r0 r1) |
292 (repeat)))))) | |
293 "CCL program to decode KOI8-U.") | |
294 | |
295 (define-ccl-program ccl-encode-koi8-u | |
296 `(1 | |
297 ((loop | |
298 (read-multibyte-character r0 r1) | |
299 (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
|
300 (if (r0 != ,(charset-id 'ascii)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
301 (if (r0 != ,(charset-id 'eight-bit-graphic)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
302 (if (r0 != ,(charset-id 'eight-bit-control)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
303 (r1 = ??)))) |
46500 | 304 (write-repeat r1)))) |
305 "CCL program to encode KOI8-U.") | |
306 | |
307 (cyrillic-unify-encoding 'cyrillic-koi8-u-encode-table) | |
308 | |
309 (make-coding-system | |
310 'koi8-u 4 | |
311 ?U "KOI8-U 8-bit encoding for Cyrillic (MIME: KOI8-U)" | |
312 '(ccl-decode-koi8-u . ccl-encode-koi8-u) | |
313 `((safe-chars . cyrillic-koi8-u-encode-table) | |
314 (mime-charset . koi8-u) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
315 (valid-codes (0 . 255)) |
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
316 (dependency unify-8859-on-encoding-mode unify-8859-on-decoding-mode))) |
46500 | 317 |
318 (define-ccl-program ccl-encode-koi8-u-font | |
319 `(0 | |
320 (translate-character cyrillic-koi8-u-encode-table r0 r1)) | |
321 "CCL program to encode Cyrillic chars to KOI-U font.") | |
322 | |
323 (add-to-list 'font-ccl-encoder-alist '("koi8-u" . ccl-encode-koi8-u-font)) | |
324 | |
325 (set-language-info-alist | |
326 "Ukrainian" `((coding-system koi8-u) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
327 (coding-priority koi8-u) |
46500 | 328 (nonascii-translation |
47416
2ff3f5116672
("Ukrainian"): Fix nonascii-translation.
Dave Love <fx@gnu.org>
parents:
46500
diff
changeset
|
329 . ,(get 'cyrillic-koi8-u-nonascii-translation-table |
46500 | 330 'translation-table)) |
331 (input-method . "ukrainian-computer") | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
332 (documentation |
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
333 . "Support for Ukrainian with KOI8-U character set.")) |
46500 | 334 '("Cyrillic")) |
335 | |
336 ;;; ALTERNATIVNYJ stuff | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
337 |
47416
2ff3f5116672
("Ukrainian"): Fix nonascii-translation.
Dave Love <fx@gnu.org>
parents:
46500
diff
changeset
|
338 ;; 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
|
339 ;; 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
|
340 ;; but nothing that looks really definitive. |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
341 (defvar cyrillic-alternativnyj-decode-table |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
342 [ |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
343 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
|
344 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
|
345 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
|
346 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
|
347 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
|
348 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
|
349 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
350 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
46500 | 351 ;; ?$,1(0(B ?$,1(1(B ?$,1(2(B ?$,1(3(B ?$,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 |
352 ;; ?$,1(@(B ?$,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 | |
353 ;; ?$,1(P(B ?$,1(Q(B ?$,1(R(B ?$,1(S(B ?$,1(T(B ?$,1(U(B ?$,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 | |
354 ;; ?$,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 | |
355 ;; ?$,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 | |
356 ;; ?$,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 | |
357 ;; ?$,1(`(B ?$,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
|
358 ;; ?$,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 | 359 ;; 8859+Unicode |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
360 ?,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
|
361 ?,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
|
362 ?,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 | 363 ?$,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 |
364 ?$,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 | |
365 ?$,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
|
366 ?,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
|
367 ;; 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
|
368 ;; 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
|
369 ;; table. |
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
370 ?,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
|
371 "Cyrillic ALTERNATIVNYJ decoding table.") |
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
372 |
29453 | 373 (let ((table (make-translation-table-from-vector |
374 cyrillic-alternativnyj-decode-table))) | |
375 (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
|
376 table) |
29453 | 377 (define-translation-table 'cyrillic-alternativnyj-encode-table |
378 (char-table-extra-slot table 0))) | |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
379 |
46500 | 380 (makunbound 'cyrillic-alternativnyj-decode-table) |
22881
e0e17bbd8e6c
(cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
381 |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
382 (define-ccl-program ccl-decode-alternativnyj |
46500 | 383 `(4 |
29453 | 384 ((loop |
385 (r0 = 0) | |
386 (read r1) | |
387 (if (r1 < 128) | |
388 (write-repeat r1) | |
389 ((translate-character cyrillic-alternativnyj-nonascii-translation-table | |
390 r0 r1) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
391 (translate-character ucs-translation-table-for-decode r0 r1) |
29453 | 392 (write-multibyte-character r0 r1) |
393 (repeat)))))) | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
394 "CCL program to decode Alternativnyj.") |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
395 |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
396 (define-ccl-program ccl-encode-alternativnyj |
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
397 `(1 |
29453 | 398 ((loop |
399 (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
|
400 (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
|
401 (if (r0 != ,(charset-id 'ascii)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
402 (if (r0 != ,(charset-id 'eight-bit-graphic)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
403 (if (r0 != ,(charset-id 'eight-bit-control)) |
351ae4e51f08
(ccl-encode-koi8, ccl-encode-koi8-u)
Kenichi Handa <handa@m17n.org>
parents:
48547
diff
changeset
|
404 (r1 = ??)))) |
29453 | 405 (write-repeat r1)))) |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
406 "CCL program to encode Alternativnyj.") |
46500 | 407 |
408 (cyrillic-unify-encoding 'cyrillic-alternativnyj-encode-table) | |
409 | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
410 (make-coding-system |
18308 | 411 'cyrillic-alternativnyj 4 ?A |
47906
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
412 "ALTERNATIVNYJ 8-bit encoding for Cyrillic." |
21663
a03ddc4a728b
FLAGS arguments for make-coding-system changed.
Kenichi Handa <handa@m17n.org>
parents:
20745
diff
changeset
|
413 '(ccl-decode-alternativnyj . ccl-encode-alternativnyj) |
46500 | 414 `((safe-chars . cyrillic-alternativnyj-encode-table) |
415 (valid-codes (0 . 255)) | |
47702
e0786a68f34e
(ccl-decode-koi8): Refer to
Kenichi Handa <handa@m17n.org>
parents:
47416
diff
changeset
|
416 (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
|
417 |
18520
383d11185239
Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18454
diff
changeset
|
418 (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj) |
18308 | 419 |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
420 (define-ccl-program ccl-encode-alternativnyj-font |
46500 | 421 `(0 |
422 (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
|
423 "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
|
424 |
46500 | 425 (add-to-list 'font-ccl-encoder-alist |
426 '("alternativnyj" . ccl-encode-alternativnyj-font)) | |
17085
4dafa5431293
Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
427 |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17841
diff
changeset
|
428 (set-language-info-alist |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
429 "Cyrillic-ALT" `((charset cyrillic-iso8859-5) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
430 (nonascii-translation |
29453 | 431 . ,(get 'cyrillic-alternativnyj-nonascii-translation-table |
432 'translation-table)) | |
20745 | 433 (coding-system cyrillic-alternativnyj) |
434 (coding-priority cyrillic-alternativnyj) | |
46500 | 435 (input-method . "russian-typewriter") |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
436 (features cyril-util) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22881
diff
changeset
|
437 (unibyte-display . cyrillic-alternativnyj) |
19451
933bea774c3c
Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents:
18520
diff
changeset
|
438 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") |
20745 | 439 (documentation . "Support for Cyrillic ALTERNATIVNYJ.")) |
440 '("Cyrillic")) | |
17052 | 441 |
46500 | 442 (set-language-info-alist |
443 "Tajik" `((coding-system cyrillic-koi8-t) | |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
444 (coding-priority cyrillic-koi8-t) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
445 (nonascii-translation |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
446 . ,(get 'decode-koi8-t 'translation-table)) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
447 (input-method . "russian-typewriter") ; fixme? |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
448 (features code-pages) |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
449 (documentation . "Support for Tajik using KOI8-T.")) |
46500 | 450 '("Cyrillic")) |
451 | |
52437 | 452 (eval-and-compile |
453 (setq | |
454 non-iso-charset-alist | |
455 (cp-make-coding-system | |
456 windows-1251 | |
457 [?\$,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 | |
458 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(B ?\$,1(i(B ?\$,1(j(B ?\$,1(k(B ?\$,1(l(B ?\$,1(m(B ?\$,1(n(B ?\$,1(o(B] nil ?b))) | |
465 | |
52720 | 466 (define-coding-system-alias 'cp1251 'windows-1251) |
467 | |
46500 | 468 (set-language-info-alist |
469 "Bulgarian" `((coding-system windows-1251) | |
470 (coding-priority windows-1251) | |
471 (nonascii-translation | |
472 . ,(get 'decode-windows-1251 'translation-table)) | |
47906
470049d232d2
(cyrillic-alternativnyj-decode-table): Fix
Kenichi Handa <handa@m17n.org>
parents:
47702
diff
changeset
|
473 (input-method . "bulgarian-bds") |
46500 | 474 (documentation |
49795
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
475 . "Support for Bulgarian with windows-1251 character set.") |
0f184780c237
("Cyrillic-KOI8"): Fix input-method.
Dave Love <fx@gnu.org>
parents:
48832
diff
changeset
|
476 (tutorial . "TUTORIAL.bg")) |
46500 | 477 '("Cyrillic")) |
478 | |
479 (set-language-info-alist | |
480 "Belarusian" `((coding-system windows-1251) | |
481 (coding-priority windows-1251) | |
482 (nonascii-translation | |
483 . ,(get 'decode-windows-1251 'translation-table)) | |
484 (input-method . "belarusian") | |
485 (documentation | |
486 . "Support for Belarusian with windows-1251 character set. | |
487 \(The name Belarusian replaced Byelorussian in the early 1990s.)")) | |
488 '("Cyrillic")) | |
489 | |
33778 | 490 (provide 'cyrillic) |
491 | |
52401 | 492 ;;; arch-tag: bda71ae0-ba41-4cb6-a6e0-1dff542313d3 |
17052 | 493 ;;; cyrillic.el ends here |