annotate lisp/mule/cyrillic.el @ 404:2f8bb876ab1d r21-2-32

Import from CVS: tag r21-2-32
author cvs
date Mon, 13 Aug 2007 11:16:07 +0200
parents 74fd4e045ea6
children 697ef44129c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
1 ;;; cyrillic.el --- Support for Cyrillic -*- coding: iso-2022-7bit; -*-
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
2
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
3 ;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN.
333
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 ;; ISO-8859-5 staff
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
44
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
45 ;; (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
46 ;; 'cyrillic-iso-8bit 2 ?5
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
47 ;; "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)"
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
48 ;; '(ascii cyrillic-iso8859-5 nil nil
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
49 ;; nil nil nil nil nil nil nil)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
50 ;; '((safe-charsets ascii cyrillic-iso8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
51 ;; (mime-charset . iso-8859-5)))
333
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 ;; (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
54
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
55 (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
56 'iso-8859-5 'iso2022
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
57 "MIME ISO-8859-5"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
58 '(charset-g0 ascii
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
59 charset-g1 cyrillic-iso8859-5
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
60 charset-g2 t
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
61 charset-g3 t
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
62 mnemonic "ISO8/Cyr"
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
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
65 (set-language-info-alist
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
66 "Cyrillic-ISO" '((charset cyrillic-iso8859-5)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
67 (tutorial . "TUTORIAL.ru")
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
68 (coding-system iso-8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
69 (coding-priority iso-8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
70 (input-method . "cyrillic-yawerty")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
71 (features cyril-util)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
72 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
73 (documentation . "Support for Cyrillic ISO-8859-5."))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
74 '("Cyrillic"))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
75
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
76 ;; KOI-8 staff
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
77
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
78 (eval-and-compile
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
79
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
80 (defvar cyrillic-koi8-r-decode-table
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
81 [
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
82 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
83 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
84 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
85 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
86 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
87 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
88 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
89 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
90 ?$B(!(B ?$B("(B ?$B(#(B ?$B($(B ?$B(&(B ?$B(%(B ?$B('(B ?$B()(B ?$B(((B ?$B(*(B ?$B(+(B 32 ?$(G#'(B ?$(G#+(B ?$(G#/(B 32
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
91 32 ?$(C"F(B 32 32 ?$B"#(B 32 ?$B"e(B ?$A!V(B ?$A!\(B ?$A!](B ?,L (B 32 ?,A0(B ?,A2(B ?,A7(B ?,Aw(B
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
92 ?$(G#D(B 32 32 ?,Lq(B 32 32 32 32 32 32 32 32 32 32 32 ?$(G#E(B
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
93 32 32 ?$(G#G(B ?,L!(B 32 32 32 32 32 32 32 32 ?$(G#F(B 32 32 ?,A)(B
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
94 ?,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
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
95 ?,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
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
96 ?,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
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
97 ?,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 ]
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
98 "Cyrillic KOI8-R decoding table.")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
99
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
100 (defvar cyrillic-koi8-r-encode-table
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
101 (let ((table (make-vector 256 32))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
102 (i 0))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
103 (while (< i 256)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
104 (let* ((ch (aref cyrillic-koi8-r-decode-table i))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
105 (split (split-char ch)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
106 (cond ((eq (car split) 'cyrillic-iso8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
107 (aset table (logior (nth 1 split) 128) i)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
108 )
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
109 ((eq ch 32))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
110 ((eq (car split) 'ascii)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
111 (aset table ch i)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
112 )))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
113 (setq i (1+ i)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
114 table)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
115 "Cyrillic KOI8-R encoding table.")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
116
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
117 )
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
118
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
119 (define-ccl-program ccl-decode-koi8
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
120 `(3
333
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
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
123 (write-read-repeat r0 ,cyrillic-koi8-r-decode-table))))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
124 "CCL program to decode KOI8.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
125
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
126 (define-ccl-program ccl-encode-koi8
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
127 `(1
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
128 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
129 (loop
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
130 (if (r0 != ,(charset-id 'cyrillic-iso8859-5))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
131 (write-read-repeat r0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
132 ((read r0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
133 (write-read-repeat r0 , cyrillic-koi8-r-encode-table))))))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
134 "CCL program to encode KOI8.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
135
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
136 ;; (make-coding-system
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
137 ;; 'cyrillic-koi8 4
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
138 ;; ;; We used to use ?K. It is true that ?K is more strictly correct,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
139 ;; ;; but it is also used for Korean.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
140 ;; ;; So people who use koi8 for languages other than Russian
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
141 ;; ;; will have to forgive us.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
142 ;; ?R "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
143 ;; '(ccl-decode-koi8 . ccl-encode-koi8)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
144 ;; '((safe-charsets ascii cyrillic-iso8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
145 ;; (mime-charset . koi8-r)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
146 ;; (valid-codes (0 . 127) 163 179 (192 . 255))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
147 ;; (charset-origin-alist (cyrillic-iso8859-5 "KOI8-R"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
148 ;; cyrillic-encode-koi8-r-char))))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
149
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
150 ;; (define-coding-system-alias 'koi8-r 'cyrillic-koi8)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
151 ;; (define-coding-system-alias 'koi8 'cyrillic-koi8)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
152
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
153 (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
154 'koi8-r 'ccl
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
155 "Coding-system used for KOI8-R."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
156 `(decode ,ccl-decode-koi8
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
157 encode ,ccl-encode-koi8
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
158 mnemonic "KOI8"))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
159
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
160 ;; it is not correct, but XEmacs doesn't have `ccl' category...
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
161 (coding-system-put 'koi8-r 'category 'iso-8-1)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
162
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
163 ;; (define-ccl-program ccl-encode-koi8-font
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
164 ;; `(0
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
165 ;; ((r1 |= 128)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
166 ;; (r1 = r1 ,cyrillic-koi8-r-encode-table)))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
167 ;; "CCL program to encode Cyrillic chars to KOI font.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
168
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
169 ;; (setq font-ccl-encoder-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
170 ;; (cons (cons "koi8" ccl-encode-koi8-font) font-ccl-encoder-alist))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
171
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
172 ;; (defvar cyrillic-koi8-r-nonascii-translation-table
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
173 ;; (make-translation-table-from-vector cyrillic-koi8-r-decode-table)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
174 ;; "Value of `nonascii-translation-table' in Cyrillic-KOI8 language environment..")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
175
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
176 (set-language-info-alist
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
177 "Cyrillic-KOI8" '((charset cyrillic-iso8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
178 (coding-system koi8-r)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
179 (coding-priority koi8-r)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
180 (input-method . "cyrillic-yawerty")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
181 (features cyril-util)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
182 (tutorial . "TUTORIAL.ru")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
183 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
184 (documentation . "Support for Cyrillic KOI8-R."))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
185 '("Cyrillic"))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
186
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
187 ;;; ALTERNATIVNYJ staff
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
188
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
189 (eval-and-compile
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
190
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
191 (defvar cyrillic-alternativnyj-decode-table
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
192 [
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
193 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
194 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
195 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
196 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
197 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
198 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
199 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
200 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
201 ?,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
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
202 ?,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
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
203 ?,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
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
204 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
205 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
206 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
207 ?,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
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
208 ?,L!(B ?,Lq(B 32 32 32 32 32 32 32 32 32 32 32 32 32 ?,Lp(B]
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
209 "Cyrillic ALTERNATIVNYJ decoding table.")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
210
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
211 (defvar cyrillic-alternativnyj-encode-table
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
212 (let ((table (make-vector 256 32))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
213 (i 0))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
214 (while (< i 256)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
215 (let* ((ch (aref cyrillic-alternativnyj-decode-table i))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
216 (split (split-char ch)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
217 (if (eq (car split) 'cyrillic-iso8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
218 (aset table (logior (nth 1 split) 128) i)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
219 (if (/= ch 32)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
220 (aset table ch i))))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
221 (setq i (1+ i)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
222 table)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
223 "Cyrillic ALTERNATIVNYJ encoding table.")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
224
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
225 )
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
226
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
227
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
228 (define-ccl-program ccl-decode-alternativnyj
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
229 `(3
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
230 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
231 (loop
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
232 (write-read-repeat r0 ,cyrillic-alternativnyj-decode-table))))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
233 "CCL program to decode Alternativnyj.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
234
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
235 (define-ccl-program ccl-encode-alternativnyj
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
236 `(1
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
237 ((read r0)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
238 (loop
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
239 (if (r0 != ,(charset-id 'cyrillic-iso8859-5))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
240 (write-read-repeat r0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
241 ((read r0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
242 (write-read-repeat r0 ,cyrillic-alternativnyj-encode-table))))))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
243 "CCL program to encode Alternativnyj.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
244
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
245 ;; (make-coding-system
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
246 ;; 'cyrillic-alternativnyj 4 ?A
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
247 ;; "ALTERNATIVNYJ 8-bit encoding for Cyrillic"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
248 ;; '(ccl-decode-alternativnyj . ccl-encode-alternativnyj)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
249 ;; '((safe-charsets ascii cyrillic-iso8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
250 ;; (valid-codes (0 . 175) (224 . 241) 255)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
251 ;; (charset-origin-alist (cyrillic-iso8859-5 "ALTERNATIVNYJ"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
252 ;; cyrillic-encode-koi8-r-char))))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
253
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
254
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
255 ;; (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
256
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
257 (make-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
258 'alternativnyj 'ccl
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
259 "Coding-system used for Alternativnyj"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
260 `(decode ,ccl-decode-alternativnyj
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
261 encode ,ccl-encode-alternativnyj
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
262 mnemonic "Cy.Alt"))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
263
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
264 ;; it is not correct, but XEmacs doesn't have `ccl' category...
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
265 (coding-system-put 'alternativnyj 'category 'iso-8-1)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
266
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
267 ;; (define-ccl-program ccl-encode-alternativnyj-font
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
268 ;; '(0
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
269 ;; ((r1 |= 128)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
270 ;; (r1 = r1 ,cyrillic-alternativnyj-encode-table)))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
271 ;; "CCL program to encode Cyrillic chars to Alternativnyj font.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
272
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
273 ;; (setq font-ccl-encoder-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
274 ;; (cons (cons "alternativnyj" ccl-encode-alternativnyj-font)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
275 ;; font-ccl-encoder-alist))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
276
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
277 ;; (defvar cyrillic-alternativnyj-nonascii-translation-table
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
278 ;; (make-translation-table-from-vector cyrillic-alternativnyj-decode-table)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
279 ;; "Value of `nonascii-translation-table' in Cyrillic-ALT language environment.")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
280
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
281 (set-language-info-alist
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
282 "Cyrillic-ALT" '((charset cyrillic-iso8859-5)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
283 (coding-system alternativnyj)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
284 (coding-priority alternativnyj)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
285 (input-method . "cyrillic-yawerty")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
286 (features cyril-util)
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
287 (tutorial . "TUTORIAL.ru")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
288 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
289 (documentation . "Support for Cyrillic ALTERNATIVNYJ."))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 333
diff changeset
290 '("Cyrillic"))
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
291
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
292 ;;; cyrillic.el ends here