annotate lisp/language/cyrillic.el @ 40346:f6020c95e836

*** empty log message ***
author Jason Rumney <jasonr@gnu.org>
date Fri, 26 Oct 2001 19:56:32 +0000
parents 67b464da13ec
children e3ae5ef41293
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
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.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6 ;; Keywords: multilingual, Cyrillic
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13 ;; any later version.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
17071
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
23 ;; Boston, MA 02111-1307, USA.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26
37112
9bd793285be5 comment
Dave Love <fx@gnu.org>
parents: 33778
diff changeset
27 ;; The character set ISO8859-5 is supported. See
9bd793285be5 comment
Dave Love <fx@gnu.org>
parents: 33778
diff changeset
28 ;; http://www.ecma.ch/ecma1/STAND/ECMA-113.HTM. KOI-8 and
9bd793285be5 comment
Dave Love <fx@gnu.org>
parents: 33778
diff changeset
29 ;; ALTERNATIVNYJ are converted to ISO8859-5 internally.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
30
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
31 ;;; Code:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
32
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
33 ;; Cyrillic (general)
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
34
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
35 ;; ISO-8859-5 staff
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
36
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
37 (make-coding-system
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
38 'cyrillic-iso-8bit 2 ?5
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
39 "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)"
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
40 '(ascii cyrillic-iso8859-5 nil nil
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
41 nil nil nil nil nil nil nil)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
42 '((safe-charsets ascii cyrillic-iso8859-5)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
43 (mime-charset . iso-8859-5)))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
44
18520
383d11185239 Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents: 18454
diff changeset
45 (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit)
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
46
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
47 (set-language-info-alist
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
48 "Cyrillic-ISO" '((charset cyrillic-iso8859-5)
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
49 (coding-system cyrillic-iso-8bit)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
50 (coding-priority cyrillic-iso-8bit)
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
51 (input-method . "cyrillic-yawerty")
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
52 (nonascii-translation . cyrillic-iso8859-5)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
53 (unibyte-display . cyrillic-iso-8bit)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
54 (features cyril-util)
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
55 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
56 (documentation . "Support for Cyrillic ISO-8859-5."))
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
57 '("Cyrillic"))
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
58
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
59 ;; KOI-8 staff
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
60
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
61 (defvar cyrillic-koi8-r-decode-table
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
62 [
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
63 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
64 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
65 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
66 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
67 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
68 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
69 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
70 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
71 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
72 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
25827
570e07739ea2 (cyrillic-koi8-r-decode-table): Map 8-bit
Kenichi Handa <handa@m17n.org>
parents: 24946
diff changeset
73 160 161 162 ?,Lq(B 164 165 166 167 168 169 170 171 172 173 174 175
570e07739ea2 (cyrillic-koi8-r-decode-table): Map 8-bit
Kenichi Handa <handa@m17n.org>
parents: 24946
diff changeset
74 176 177 178 ?,L!(B 180 181 182 183 184 185 186 187 188 189 190 191
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
75 ?,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
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
76 ?,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
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
77 ?,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
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
78 ?,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 ]
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
79 "Cyrillic KOI8-R decoding table.")
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
80
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
81 (let ((table (make-translation-table-from-vector
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
82 cyrillic-koi8-r-decode-table)))
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
83 (define-translation-table 'cyrillic-koi8-r-nonascii-translation-table table)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
84 (define-translation-table 'cyrillic-koi8-r-encode-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
85 (char-table-extra-slot table 0)))
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
86
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
87 (define-ccl-program ccl-decode-koi8
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
88 `(3
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
89 ((loop
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
90 (r0 = 0)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
91 (read r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
92 (if (r1 < 128)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
93 (write-repeat r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
94 ((translate-character cyrillic-koi8-r-nonascii-translation-table r0 r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
95 (write-multibyte-character r0 r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
96 (repeat))))))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
97 "CCL program to decode KOI8.")
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
98
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
99 (define-ccl-program ccl-encode-koi8
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
100 `(1
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
101 ((loop
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
102 (read-multibyte-character r0 r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
103 (if (r0 == ,(charset-id 'cyrillic-iso8859-5))
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
104 (translate-character cyrillic-koi8-r-encode-table r0 r1))
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
105 (write-repeat r1))))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
106 "CCL program to encode KOI8.")
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
107
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
108 (make-coding-system
18203
0745f30aec66 Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents: 18155
diff changeset
109 'cyrillic-koi8 4
18116
7839aa2f6765 (koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents: 17993
diff changeset
110 ;; 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
111 ;; 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
112 ;; 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
113 ;; will have to forgive us.
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
114 ?R "KOI8 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
115 '(ccl-decode-koi8 . ccl-encode-koi8)
30495
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
116 `((safe-chars . ,(let ((table (make-char-table 'safe-chars))
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
117 (i 0))
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
118 (while (< i 256)
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
119 (aset table (aref cyrillic-koi8-r-decode-table i) t)
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
120 (setq i (1+ i)))
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
121 table))
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
122 (mime-charset . koi8-r)
24297
a5b2e26efe7c (cyrillic-koi8): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents: 23158
diff changeset
123 (valid-codes (0 . 127) 163 179 (192 . 255))
a5b2e26efe7c (cyrillic-koi8): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents: 23158
diff changeset
124 (charset-origin-alist (cyrillic-iso8859-5 "KOI8-R"
a5b2e26efe7c (cyrillic-koi8): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents: 23158
diff changeset
125 cyrillic-encode-koi8-r-char))))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
126
18520
383d11185239 Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents: 18454
diff changeset
127 (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
128 (define-coding-system-alias 'koi8 'cyrillic-koi8)
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
129
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
130 (define-ccl-program ccl-encode-koi8-font
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
131 `(0
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
132 ((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
133 "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
134
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
135 (setq font-ccl-encoder-alist
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
136 (cons '("koi8" . ccl-encode-koi8-font) font-ccl-encoder-alist))
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
137
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
138 (set-language-info-alist
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
139 "Cyrillic-KOI8" `((charset cyrillic-iso8859-5)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
140 (nonascii-translation
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
141 . ,(get 'cyrillic-koi8-r-nonascii-translation-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
142 'translation-table))
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
143 (coding-system cyrillic-koi8)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
144 (coding-priority cyrillic-koi8)
24946
0856eb4dd6ec ("Cyrillic-KOI8", "Cyrillic-ALT"): Use cyrillic-jcuken as default input method.
Richard M. Stallman <rms@gnu.org>
parents: 24297
diff changeset
145 (input-method . "cyrillic-jcuken")
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
146 (features cyril-util)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
147 (unibyte-display . cyrillic-koi8)
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
148 (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
149 (documentation . "Support for Cyrillic KOI8-R."))
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
150 '("Cyrillic"))
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
151
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
152 ;;; ALTERNATIVNYJ staff
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
153
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
154 (defvar cyrillic-alternativnyj-decode-table
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
155 [
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
156 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
157 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
158 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
159 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
160 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
161 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
162 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
163 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
164 ?,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
165 ?,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
166 ?,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
25827
570e07739ea2 (cyrillic-koi8-r-decode-table): Map 8-bit
Kenichi Handa <handa@m17n.org>
parents: 24946
diff changeset
167 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
570e07739ea2 (cyrillic-koi8-r-decode-table): Map 8-bit
Kenichi Handa <handa@m17n.org>
parents: 24946
diff changeset
168 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
570e07739ea2 (cyrillic-koi8-r-decode-table): Map 8-bit
Kenichi Handa <handa@m17n.org>
parents: 24946
diff changeset
169 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
170 ?,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
25827
570e07739ea2 (cyrillic-koi8-r-decode-table): Map 8-bit
Kenichi Handa <handa@m17n.org>
parents: 24946
diff changeset
171 ?,L!(B ?,Lq(B 242 243 244 245 246 247 248 249 250 251 252 253 254 ?,Lp(B]
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
172 "Cyrillic ALTERNATIVNYJ decoding table.")
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
173
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
174 (let ((table (make-translation-table-from-vector
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
175 cyrillic-alternativnyj-decode-table)))
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
176 (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
177 table)
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
178 (define-translation-table 'cyrillic-alternativnyj-encode-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
179 (char-table-extra-slot table 0)))
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
180
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
181
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
182 (define-ccl-program ccl-decode-alternativnyj
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
183 `(3
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
184 ((loop
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
185 (r0 = 0)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
186 (read r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
187 (if (r1 < 128)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
188 (write-repeat r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
189 ((translate-character cyrillic-alternativnyj-nonascii-translation-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
190 r0 r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
191 (write-multibyte-character r0 r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
192 (repeat))))))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
193 "CCL program to decode Alternativnyj.")
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
194
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
195 (define-ccl-program ccl-encode-alternativnyj
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
196 `(1
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
197 ((loop
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
198 (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
199 (translate-character cyrillic-alternativnyj-encode-table r0 r1)
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
200 (write-repeat r1))))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
201 "CCL program to encode Alternativnyj.")
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
202
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
203 (make-coding-system
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
204 'cyrillic-alternativnyj 4 ?A
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
205 "ALTERNATIVNYJ 8-bit encoding for Cyrillic"
21663
a03ddc4a728b FLAGS arguments for make-coding-system changed.
Kenichi Handa <handa@m17n.org>
parents: 20745
diff changeset
206 '(ccl-decode-alternativnyj . ccl-encode-alternativnyj)
30495
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
207 `((safe-chars . ,(let ((table (make-char-table 'safe-chars))
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
208 (i 0))
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
209 (while (< i 256)
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
210 (aset table (aref cyrillic-alternativnyj-decode-table i)
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
211 t)
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
212 (setq i (1+ i)))
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
213 table))
24297
a5b2e26efe7c (cyrillic-koi8): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents: 23158
diff changeset
214 (valid-codes (0 . 175) (224 . 241) 255)
a5b2e26efe7c (cyrillic-koi8): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents: 23158
diff changeset
215 (charset-origin-alist (cyrillic-iso8859-5 "ALTERNATIVNYJ"
a5b2e26efe7c (cyrillic-koi8): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents: 23158
diff changeset
216 cyrillic-encode-koi8-r-char))))
a5b2e26efe7c (cyrillic-koi8): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents: 23158
diff changeset
217
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
218
18520
383d11185239 Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents: 18454
diff changeset
219 (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj)
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
220
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
221 (define-ccl-program ccl-encode-alternativnyj-font
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
222 '(0
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
223 ((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
224 "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
225
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
226 (setq font-ccl-encoder-alist
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
227 (cons '("alternativnyj" . ccl-encode-alternativnyj-font)
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
228 font-ccl-encoder-alist))
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
229
17993
73869115ae0a Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents: 17841
diff changeset
230 (set-language-info-alist
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
231 "Cyrillic-ALT" `((charset cyrillic-iso8859-5)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
232 (nonascii-translation
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
233 . ,(get 'cyrillic-alternativnyj-nonascii-translation-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
234 'translation-table))
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
235 (coding-system cyrillic-alternativnyj)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
236 (coding-priority cyrillic-alternativnyj)
24946
0856eb4dd6ec ("Cyrillic-KOI8", "Cyrillic-ALT"): Use cyrillic-jcuken as default input method.
Richard M. Stallman <rms@gnu.org>
parents: 24297
diff changeset
237 (input-method . "cyrillic-jcuken")
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
238 (features cyril-util)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
239 (unibyte-display . cyrillic-alternativnyj)
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
240 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
241 (documentation . "Support for Cyrillic ALTERNATIVNYJ."))
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
242 '("Cyrillic"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
243
33778
6d966e8b4bbe Use provide.
Dave Love <fx@gnu.org>
parents: 30495
diff changeset
244 (provide 'cyrillic)
6d966e8b4bbe Use provide.
Dave Love <fx@gnu.org>
parents: 30495
diff changeset
245
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
246 ;;; cyrillic.el ends here