annotate lisp/mule/cyrillic.el @ 357:4711e16a8e49 r21-1-8

Import from CVS: tag r21-1-8
author cvs
date Mon, 13 Aug 2007 10:57:04 +0200
parents 4f79e16b1112
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
1 ;;; cyrillic.el --- Support for languages which use Cyrillic characters
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
2
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
4 ;; Licensed to the Free Software Foundation.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
6
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
7 ;; Keywords: multilingual, Cyrillic
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
8
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
10
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
14 ;; any later version.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
15
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
19 ;; General Public License for more details.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
20
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
24 ;; 02111-1307, USA.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
25
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
26 ;;; Commentary:
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
27
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
28 ;; The character set ISO8859-5 is supported. KOI-8 and ALTERNATIVNYJ
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
29 ;; are converted to ISO8859-5 internally.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
30
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
31 ;;; Code:
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
33 ;; For syntax of Cyrillic
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
34 (modify-syntax-entry 'cyrillic-iso8859-5 "w")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
35 (modify-syntax-entry ?,L-(B ".")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
36 (modify-syntax-entry ?,Lp(B ".")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
37 (modify-syntax-entry ?,L}(B ".")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
38
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
40 ;;; CYRILLIC
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
41 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
42
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
43 ;; (define-prefix-command 'describe-cyrillic-environment-map)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
44 ;; (define-key-after describe-language-environment-map [Cyrillic]
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
45 ;; '("Cyrillic" . describe-cyrillic-environment-map)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
46 ;; t)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
47
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
48 ;; (define-prefix-command 'setup-cyrillic-environment-map)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
49 ;; (define-key-after setup-language-environment-map [Cyrillic]
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
50 ;; '("Cyrillic" . setup-cyrillic-environment-map)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
51 ;; t)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
52
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
53
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
54 ;; ISO-8859-5 staff
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
55
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
56 ;; (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
57 ;; 'cyrillic-iso-8bit 2 ?5
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
58 ;; "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
59 ;; '((ascii t) (cyrillic-iso8859-5 t) nil nil
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
60 ;; nil ascii-eol ascii-cntl nil nil nil nil))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
61
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
62 ;; (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
63
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
64 (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
65 'iso-8859-5 'iso2022
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
66 "MIME ISO-8859-5"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
67 '(charset-g0 ascii
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
68 charset-g1 cyrillic-iso8859-5
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
69 charset-g2 t
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
70 charset-g3 t
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
71 mnemonic "ISO8/Cyr"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
72 ))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
73
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
74 (set-language-info-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
75 "Cyrillic-ISO" '((setup-function . (setup-cyrillic-iso-environment
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
76 . setup-cyrillic-environment-map))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
77 (charset . (cyrillic-iso8859-5))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
78 (tutorial . "TUTORIAL.ru")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
79 (coding-system . (iso-8859-5))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
80 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
81 (documentation . ("Support for Cyrillic ISO-8859-5."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
82 . describe-cyrillic-environment-map))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
83
357
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
84 (defun setup-cyrillic-iso-environment ()
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
85 "Setup multilingual environment (MULE) for Cyrillic ISO-8859-5 users."
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
86 (interactive)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
87 (setup-english-environment)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
88 (set-coding-category-system 'iso-8-1 'iso-8859-5)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
89 (set-coding-priority-list
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
90 '(iso-8-1))
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
91 (set-default-coding-systems 'iso-8859-5))
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
92
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
93 ;; KOI-8 staff
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
94
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
95 (define-ccl-program ccl-decode-koi8
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
96 '(3
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
97 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
98 (loop
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
99 (write-read-repeat
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
100 r0
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
101 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
102 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
103 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
104 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
105 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
106 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
107 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
108 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
109 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
110 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
111 32 32 32 ?,Lq(B 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
112 32 32 32 ?,L!(B 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
113 ?,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
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
114 ?,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
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
115 ?,LN(B ?,L0(B ?,L1(B ?,LF(B ?,L4(B ?,L5(B ?,LD(B ?,L3(B ?,LE(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
116 ?,L?(B ?,LO(B ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,L6(B ?,L2(B ?,LL(B ?,LK(B ?,L7(B ?,LH(B ?,LM(B ?,LI(B ?,LG(B ?,LJ(B ]))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
117 "CCL program to decode KOI8.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
118
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
119 (define-ccl-program ccl-encode-koi8
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
120 `(1
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
121 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
122 (loop
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
123 (if (r0 != ,(charset-id 'cyrillic-iso8859-5))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
124 (write-read-repeat r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
125 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
126 (r0 -= 160)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
127 (write-read-repeat
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
128 r0
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
129 [ 32 179 32 32 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
130 225 226 247 231 228 229 246 250 233 234 235 236 237 238 239 240
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
131 242 243 244 245 230 232 227 254 251 253 255 249 248 252 224 241
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
132 193 194 215 199 196 197 214 218 201 202 203 204 205 206 207 208
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
133 210 211 212 213 198 200 195 222 219 221 223 217 216 220 192 209
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
134 32 163 32 32 32 32 32 32 32 32 32 32 32 32 32 32])
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
135 )))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
136 "CCL program to encode KOI8.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
137
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
138 ;(make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
139 ; 'cyrillic-koi8 4
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
140 ; ;; We used to use ?K. It is true that ?K is more strictly correct,
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
141 ; ;; but it is also used for Korean.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
142 ; ;; So people who use koi8 for languages other than Russian
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
143 ; ;; will have to forgive us.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
144 ; ?R "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
145 ; (cons ccl-decode-koi8 ccl-encode-koi8))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
146
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
147 ;(define-coding-system-alias 'koi8-r 'cyrillic-koi8)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
148 ;(define-coding-system-alias 'koi8 'cyrillic-koi8)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
149
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
150 (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
151 'koi8-r 'ccl
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
152 "Coding-system used for KOI8-R."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
153 `(decode ,ccl-decode-koi8
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
154 encode ,ccl-encode-koi8
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
155 mnemonic "KOI8"))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
156
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
157 ;(define-coding-system-alias 'koi8-r 'koi8)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
158
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
159 ;; (define-ccl-program ccl-encode-koi8-font
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
160 ;; '(0
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
161 ;; ((r1 -= 160)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
162 ;; (r1 = r1
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
163 ;; [ 32 179 32 32 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
164 ;; 225 226 247 231 228 229 246 250 233 234 235 236 237 238 239 240
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
165 ;; 242 243 244 245 230 232 227 254 251 253 255 249 248 252 224 241
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
166 ;; 193 194 215 199 196 197 214 218 201 202 203 204 205 206 207 208
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
167 ;; 210 211 212 213 198 200 195 222 219 221 223 217 216 220 192 209
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
168 ;; 32 163 32 32 32 32 32 32 32 32 32 32 32 32 32 32])
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
169 ;; ))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
170 ;; "CCL program to encode Cyrillic chars to KOI font.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
171
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
172 ;; (setq font-ccl-encoder-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
173 ;; (cons (cons "koi8" ccl-encode-koi8-font) font-ccl-encoder-alist))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
174
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
175 (set-language-info-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
176 "Cyrillic-KOI8" '((setup-function . (setup-cyrillic-koi8-environment
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
177 . setup-cyrillic-environment-map))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
178 (charset . (cyrillic-iso8859-5))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
179 (coding-system . (koi8-r))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
180 (tutorial . "TUTORIAL.ru")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
181 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
182 (documentation . ("Support for Cyrillic KOI-8."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
183 . describe-cyrillic-environment-map))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
184
357
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
185 (defun setup-cyrillic-koi8-environment ()
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
186 "Setup multilingual environment (MULE) for Cyrillic KOI8 users."
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
187 (interactive)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
188 (setup-english-environment)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
189 (set-coding-category-system 'iso-8-1 'koi8-r)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
190 (set-coding-priority-list
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
191 '(iso-8-1))
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
192 (set-default-coding-systems 'koi8-r))
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
193
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
194 ;;; ALTERNATIVNYJ staff
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
195
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
196 (define-ccl-program ccl-decode-alternativnyj
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
197 '(3
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
198 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
199 (loop
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
200 (write-read-repeat
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
201 r0
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
202 [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
203 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
204 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
205 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
206 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
207 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
208 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
209 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
210 ?,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
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
211 ?,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
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
212 ?,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
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
213 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
214 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
215 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
216 ?,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
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
217 ?,L!(B ?,Lq(B 32 32 32 32 32 32 32 32 32 32 32 32 32 ?,Lp(B]))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
218 "CCL program to decode Alternativnyj.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
219
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
220 (define-ccl-program ccl-encode-alternativnyj
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
221 `(1
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
222 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
223 (loop
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
224 (if (r0 != ,(charset-id 'cyrillic-iso8859-5))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
225 (write-read-repeat r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
226 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
227 (r0 -= 160)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
228 (write-read-repeat
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
229 r0
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
230 [ 32 240 32 32 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
231 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
232 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
233 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
234 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
235 255 241 32 32 32 32 32 32 32 32 32 32 32 32 32 32])
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
236 )))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
237 "CCL program to encode Alternativnyj.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
238
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
239 ;; (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
240 ;; 'alternativnyj 4
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
241 ;; ?A "Coding-system used for Alternativnyj"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
242 ;; (cons ccl-decode-alternativnyj ccl-encode-alternativnyj))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
243
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
244 (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
245 'alternativnyj 'ccl
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
246 "Coding-system used for Alternativnyj"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
247 `(decode ,ccl-decode-alternativnyj
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
248 encode ,ccl-encode-alternativnyj
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
249 mnemonic "Cy.Alt"))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
250
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
251 ;; (define-ccl-program ccl-encode-alternativnyj-font
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
252 ;; '(0
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
253 ;; ((r1 -= 160)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
254 ;; (r1 = r1
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
255 ;; [ 32 240 32 32 32 32 32 32 32 32 32 32 32 32 32 32
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
256 ;; 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
257 ;; 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
258 ;; 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
259 ;; 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
260 ;; 255 241 32 32 32 32 32 32 32 32 32 32 32 32 32 32])
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
261 ;; ))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
262 ;; "CCL program to encode Cyrillic chars to Alternativnyj font.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
263
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
264 ;; (setq font-ccl-encoder-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
265 ;; (cons (cons "alternativnyj" ccl-encode-alternativnyj-font)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
266 ;; font-ccl-encoder-alist))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
267
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
268 (set-language-info-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
269 "Cyrillic-ALT" '((setup-function . (setup-cyrillic-alternativnyj-environment
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
270 . setup-cyrillic-environment-map))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
271 (charset . (cyrillic-iso8859-5))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
272 (coding-system . (alternativnyj))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
273 (tutorial . "TUTORIAL.ru")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
274 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
275 (documentation . ("Support for Cyrillic ALTERNATIVNYJ."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
276 . describe-cyrillic-environment-map))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
277
357
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
278 (defun setup-cyrillic-alternativnyj-environment ()
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
279 "Setup multilingual environment (MULE) for Cyrillic ALTERNATIVNYJ users."
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
280 (interactive)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
281 (setup-english-environment)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
282 (set-coding-category-system 'iso-8-1 'alternativnyj)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
283 (set-coding-priority-list
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
284 '(iso-8-1))
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
285 (set-default-coding-systems 'alternativnyj))
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
286
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
287 ;;; GENERAL
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
288
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
289 (defun setup-cyrillic-environment ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
290 "Setup multilingual environment for Cyrillic users."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
291 (interactive)
357
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
292 (set-coding-category-system 'iso-8-1 'iso-8859-5)
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
293 (set-coding-priority-list
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
294 '(iso-8-1))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
295
357
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
296 (set-default-coding-systems 'iso-8859-5)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
297
357
4711e16a8e49 Import from CVS: tag r21-1-8
cvs
parents: 333
diff changeset
298 (setq default-input-method 'cyrillic-yawerty)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
299 )
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
300
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
301 (set-language-info-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
302 "Cyrillic" '((setup-function . setup-cyrillic-environment)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
303 (charset . (cyrillic-iso8859-5))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
304 (tutorial . "TUTORIAL.ru")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
305 (coding-system . (iso-8859-5 koi8-r alternativnyj))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
306 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
307 (documentation . nil)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
308
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
309 ;;; cyrillic.el ends here