Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
e1915ab3
Commit
e1915ab3
authored
Mar 01, 2002
by
Kenichi Handa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call define-coding-system instead of make-coding-system. All CCL program deleted.
parent
c1841772
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
321 additions
and
900 deletions
+321
-900
lisp/language/chinese.el
lisp/language/chinese.el
+67
-202
lisp/language/cyrillic.el
lisp/language/cyrillic.el
+26
-164
lisp/language/european.el
lisp/language/european.el
+80
-267
lisp/language/greek.el
lisp/language/greek.el
+8
-9
lisp/language/hebrew.el
lisp/language/hebrew.el
+9
-10
lisp/language/indian.el
lisp/language/indian.el
+10
-8
lisp/language/japanese.el
lisp/language/japanese.el
+55
-47
lisp/language/korean.el
lisp/language/korean.el
+16
-15
lisp/language/lao.el
lisp/language/lao.el
+9
-24
lisp/language/thai.el
lisp/language/thai.el
+10
-13
lisp/language/tibetan.el
lisp/language/tibetan.el
+11
-10
lisp/language/vietnamese.el
lisp/language/vietnamese.el
+20
-131
No files found.
lisp/language/chinese.el
View file @
e1915ab3
...
...
@@ -33,47 +33,50 @@
;;; Chinese (general)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(
make-coding-system
'iso-2022-cn
2
?C
(
define-coding-system
'iso-2022-cn
"ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN)."
'
(
ascii
(
nil
chinese-gb2312
chinese-cns11643-1
)
(
nil
chinese-cns11643-2
)
nil
nil
ascii-eol
ascii-cntl
seven
locking-shift
single-shift
nil
nil
nil
init-bol
)
'
((
safe-charsets
ascii
chinese-gb2312
chinese-cns11643-1
chinese-cns11643-2
)
(
mime-charset
.
iso-2022-cn
)))
:coding-type
'iso-2022
:mnemonic
?C
:charset-list
'
(
ascii
chinese-gb2312
chinese-cns11643-1
chinese-cns11643-2
)
:designation
[ascii
(
nil
chinese-gb2312
chinese-cns11643-1
)
(
nil
chinese-cns11643-2
)
nil]
:flags
'
(
ascii-at-eol
ascii-at-cntl
7-bit
designation
locking-shift
single-shift
init-at-bol
)
:plist
'
(
mime-charset
.
iso-2022-cn
))
(
define-coding-system-alias
'chinese-iso-7bit
'iso-2022-cn
)
(
make-coding-system
'iso-2022-cn-ext
2
?C
"ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)."
'
(
ascii
(
nil
chinese-gb2312
chinese-cns11643-1
)
(
nil
chinese-cns11643-2
)
(
nil
chinese-cns11643-3
chinese-cns11643-4
chinese-cns11643-5
chinese-cns11643-6
chinese-cns11643-7
)
nil
ascii-eol
ascii-cntl
seven
locking-shift
single-shift
nil
nil
nil
init-bol
)
'
((
safe-charsets
ascii
chinese-gb2312
chinese-cns11643-1
chinese-cns11643-2
chinese-cns11643-3
chinese-cns11643-4
chinese-cns11643-5
chinese-cns11643-6
chinese-cns11643-7
)
(
mime-charset
.
iso-2022-cn-ext
)))
(
define-coding-system
'iso-2022-cn-ext
"ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)."
:coding-type
'iso-2022
:mnemonic
?C
:charset-list
'
(
ascii
chinese-gb2312
chinese-cns11643-1
chinese-cns11643-2
chinese-cns11643-3
chinese-cns11643-4
chinese-cns11643-5
chinese-cns11643-6
chinese-cns11643-7
)
:designation
'[ascii
(
nil
chinese-gb2312
chinese-cns11643-1
)
(
nil
chinese-cns11643-2
)
(
nil
chinese-cns11643-3
chinese-cns11643-4
chinese-cns11643-5
chinese-cns11643-6
chinese-cns11643-7
)
]
:flags
'
(
ascii-at-eol
ascii-at-cntl
7-bit
designation
locking-shift
single-shift
init-at-bol
)
:plist
'
(
mime-charset
iso-2022-cn-ext
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Chinese GB2312 (simplified)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(
mak
e-coding-system
'chinese-iso-8bit
2
?c
"ISO 2022 based EUC encoding for Chinese GB2312 (MIME:GB2312)."
'
(
ascii
chinese-gb2312
nil
nil
nil
ascii-eol
ascii-cntl
nil
nil
nil
nil
)
'
((
safe-charsets
ascii
chinese-gb2312
)
(
mime-charset
.
gb2312
)
))
(
defin
e-coding-system
'chinese-iso-8bit
"ISO 2022 based EUC encoding for Chinese GB2312 (MIME:CN-GB)."
:coding-type
'iso-2022
:mnemonic
?c
:charset-list
'
(
ascii
chinese-gb2312
)
:designation
[
ascii
chinese-gb2312
nil
nil]
:plist
'
(
mime-charset
cn-gb
))
(
define-coding-system-alias
'cn-gb-2312
'chinese-iso-8bit
)
(
define-coding-system-alias
'euc-china
'chinese-iso-8bit
)
...
...
@@ -81,14 +84,14 @@
(
define-coding-system-alias
'cn-gb
'chinese-iso-8bit
)
(
define-coding-system-alias
'gb2312
'chinese-iso-8bit
)
(
make-coding-system
'chinese-hz
0
?z
(
define-coding-system
'chinese-hz
"Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)."
nil
'
((
safe-charsets
ascii
chinese-gb2312
)
(
mime-charset
.
hz-gb-2312
)
(
post-read-conversion
.
post-read-decode-hz
)
(
pre-write-conversion
.
pre-write-encode-hz
)))
:coding-type
'utf-8
:mnemonic
?z
:charset-list
'
(
ascii
chinese-gb2312
)
:plist
'
(
mime-charset
hz-gb-2312
)
:post-read-conversion
'post-read-decode-hz
:pre-write-conversion
'pre-write-encode-hz
)
(
define-coding-system-alias
'hz-gb-2312
'chinese-hz
)
(
define-coding-system-alias
'hz
'chinese-hz
)
...
...
@@ -125,36 +128,16 @@
;; Chinese BIG5 (traditional)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(
make-coding-system
'chinese-big5
3
?B
"BIG5 8-bit encoding for Chinese (MIME:Big5)."
nil
'
((
safe-charsets
ascii
chinese-big5-1
chinese-big5-2
)
(
mime-charset
.
big5
)
(
charset-origin-alist
(
chinese-big5-1
"BIG5"
encode-big5-char
)
(
chinese-big5-2
"BIG5"
encode-big5-char
))))
(
define-coding-system
'chinese-big5
"BIG5 8-bit encoding for Chinese (MIME:Big5)"
:coding-type
'big5
:mnemonic
?B
:charset-list
'
(
ascii
big5
)
:plist
'
(
mime-charset
big5
))
(
define-coding-system-alias
'big5
'chinese-big5
)
(
define-coding-system-alias
'cn-big5
'chinese-big5
)
;; Big5 font requires special encoding.
(
define-ccl-program
ccl-encode-big5-font
`
(
0
;; In: R0:chinese-big5-1 or chinese-big5-2
;; R1:position code 1
;; R2:position code 2
;; Out: R1:font code point 1
;; R2:font code point 2
((
r2
=
((((
r1
-
?\x21
)
*
94
)
+
r2
)
-
?\x21
))
(
if
(
r0
==
,
(
charset-id
'chinese-big5-2
))
(
r2
+=
6280
))
(
r1
=
((
r2
/
157
)
+
?\xA1
))
(
r2
%=
157
)
(
if
(
r2
<
?\x3F
)
(
r2
+=
?\x40
)
(
r2
+=
?\x62
))))
"CCL program to encode a Big5 code to code point of Big5 font."
)
(
setq
font-ccl-encoder-alist
(
cons
(
cons
"big5"
ccl-encode-big5-font
)
font-ccl-encoder-alist
))
(
set-language-info-alist
"Chinese-BIG5"
'
((
charset
chinese-big5-1
chinese-big5-2
)
(
coding-system
chinese-big5
chinese-iso-7bit
)
...
...
@@ -169,144 +152,26 @@
;; Chinese CNS11643 (traditional)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(
defvar
big5-to-cns
(
make-translation-table
)
"Translation table for encoding to `euc-tw'."
)
;; Could have been done by china-util loaded before.
(
unless
(
get
'big5-to-cns
'translation-table
)
(
define-translation-table
'big5-to-cns
big5-to-cns
))
(
define-ccl-program
ccl-decode-euc-tw
;; CNS plane 1 needs either two or four bytes in EUC-TW encoding;
;; CNS planes 2 to 7 always need four bytes. In internal encoding of
;; Emacs, CNS planes 1 and 2 need three bytes, and planes 3 to 7 need
;; four bytes. Thus a buffer magnification value of 2 (for both
;; encoding and decoding) is sufficient.
`
(
2
;; we don't have enough registers to hold all charset-ids
((
r4
=
,
(
charset-id
'chinese-cns11643-1
))
(
r5
=
,
(
charset-id
'chinese-cns11643-2
))
(
r6
=
,
(
charset-id
'chinese-cns11643-3
))
(
loop
(
read-if
(
r0
<
#x80
)
;; ASCII
(
write-repeat
r0
)
;; not ASCII
(
if
(
r0
==
#x8E
)
;; single shift
(
read-if
(
r1
<
#xA1
)
;; invalid byte
((
write
r0
)
(
write-repeat
r1
))
(
if
(
r1
>
#xA7
)
;; invalid plane
((
write
r0
)
(
write-repeat
r1
))
;; OK, we have a plane
(
read-if
(
r2
<
#xA1
)
;; invalid first byte
((
write
r0
r1
)
(
write-repeat
r2
))
(
read-if
(
r3
<
#xA1
)
;; invalid second byte
((
write
r0
r1
r2
)
(
write-repeat
r3
))
;; CNS 1-7, finally
((
branch
(
r1
-
#xA1
)
(
r1
=
r4
)
(
r1
=
r5
)
(
r1
=
r6
)
(
r1
=
,
(
charset-id
'chinese-cns11643-4
))
(
r1
=
,
(
charset-id
'chinese-cns11643-5
))
(
r1
=
,
(
charset-id
'chinese-cns11643-6
))
(
r1
=
,
(
charset-id
'chinese-cns11643-7
)))
(
r2
=
((((
r2
-
#x80
)
<<
7
)
+
r3
)
-
#x80
))
(
write-multibyte-character
r1
r2
)
(
repeat
))))))
;; standard EUC
(
if
(
r0
<
#xA1
)
;; invalid first byte
(
write-repeat
r0
)
(
read-if
(
r1
<
#xA1
)
;; invalid second byte
((
write
r0
)
(
write-repeat
r1
))
;; CNS 1, finally
((
r1
=
((((
r0
-
#x80
)
<<
7
)
+
r1
)
-
#x80
))
(
write-multibyte-character
r4
r1
)
(
repeat
)))))))))
"CCL program to decode EUC-TW encoding."
)
(
define-ccl-program
ccl-encode-euc-tw
`
(
2
;; we don't have enough registers to hold all charset-ids
((
r2
=
,
(
charset-id
'ascii
))
(
r3
=
,
(
charset-id
'chinese-big5-1
))
(
r4
=
,
(
charset-id
'chinese-big5-2
))
(
r5
=
,
(
charset-id
'chinese-cns11643-1
))
(
r6
=
,
(
charset-id
'chinese-cns11643-2
))
(
loop
(
read-multibyte-character
r0
r1
)
(
if
(
r0
==
r2
)
(
write-repeat
r1
)
(
;; Big 5 encoded characters are first translated to CNS
(
if
(
r0
==
r3
)
(
translate-character
big5-to-cns
r0
r1
)
(
if
(
r0
==
r4
)
(
translate-character
big5-to-cns
r0
r1
)))
(
if
(
r0
==
r5
)
(
r0
=
#xA1
)
(
if
(
r0
==
r6
)
(
r0
=
#xA2
)
(
if
(
r0
==
,
(
charset-id
'chinese-cns11643-3
))
(
r0
=
#xA3
)
(
if
(
r0
==
,
(
charset-id
'chinese-cns11643-4
))
(
r0
=
#xA4
)
(
if
(
r0
==
,
(
charset-id
'chinese-cns11643-5
))
(
r0
=
#xA5
)
(
if
(
r0
==
,
(
charset-id
'chinese-cns11643-6
))
(
r0
=
#xA6
)
(
if
(
r0
==
,
(
charset-id
'chinese-cns11643-7
))
(
r0
=
#xA7
)
;; not CNS. We use a dummy character which
;; can't occur in EUC-TW encoding to indicate
;; this.
(
write-repeat
#xFF
))))))))))
(
if
(
r0
!=
#xA1
)
;; single shift and CNS plane
((
write
#x8E
)
(
write
r0
)))
(
write
((
r1
>>
7
)
+
#x80
))
(
write
((
r1
%
#x80
)
+
#x80
))
(
repeat
))))
"CCL program to encode EUC-TW encoding."
)
(
defun
euc-tw-pre-write-conversion
(
beg
end
)
"Semi-dummy pre-write function effectively to autoload china-util."
;; Ensure translation table is loaded.
(
require
'china-util
)
;; Don't do this again.
(
coding-system-put
'euc-tw
'pre-write-conversion
nil
)
nil
)
(
make-coding-system
'euc-tw
4
?Z
"ISO 2022 based EUC encoding for Chinese CNS11643.
Big5 encoding is accepted for input also (which is then converted to CNS)."
'
(
ccl-decode-euc-tw
.
ccl-encode-euc-tw
)
'
((
safe-charsets
ascii
chinese-big5-1
chinese-big5-2
chinese-cns11643-1
chinese-cns11643-2
chinese-cns11643-3
chinese-cns11643-4
chinese-cns11643-5
chinese-cns11643-6
chinese-cns11643-7
)
(
valid-codes
(
0
.
255
))
(
pre-write-conversion
.
euc-tw-pre-write-conversion
)))
(
define-coding-system
'euc-tw
"ISO 2022 based EUC encoding for Chinese CNS11643."
:coding-type
'iso-2022
:mnemonic
?Z
:charset-list
'
(
ascii
chinese-cns11643-1
chinese-cns11643-2
chinese-cns11643-3
chinese-cns11643-4
chinese-cns11643-5
chinese-cns11643-6
chinese-cns11643-7
)
:designation
[ascii
chinese-cns11643-1
(
chinese-cns11643-1
chinese-cns11643-2
chinese-cns11643-3
chinese-cns11643-4
chinese-cns11643-5
chinese-cns11643-6
chinese-cns11643-7
)
nil]
:plist
'
(
mime-charset
euc-tw
))
(
define-coding-system-alias
'euc-taiwan
'euc-tw
)
...
...
lisp/language/cyrillic.el
View file @
e1915ab3
...
...
@@ -34,22 +34,21 @@
;; ISO-8859-5 staff
(
make-coding-system
'cyrillic-iso-8bit
2
?5
"ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)."
'
(
ascii
cyrillic-iso8859-5
nil
nil
nil
nil
nil
nil
nil
nil
nil
)
'
((
safe-charsets
ascii
cyrillic-iso8859-5
)
(
mime-charset
.
iso-8859-5
)))
(
define-coding-system
'cyrillic-iso-8bit
"ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)."
:coding-type
'charset
:mnemonic
?5
:charset-list
'
(
iso-8859-5
)
:plist
'
(
mime-charset
iso-8859-5
))
(
define-coding-system-alias
'iso-8859-5
'cyrillic-iso-8bit
)
(
set-language-info-alist
"Cyrillic-ISO"
'
((
charset
cyrillic-
iso8859-5
)
"Cyrillic-ISO"
'
((
charset
iso
-
8859-5
)
(
coding-system
cyrillic-iso-8bit
)
(
coding-priority
cyrillic-iso-8bit
)
(
nonascii-translation
.
iso-8859-5
)
(
input-method
.
"cyrillic-yawerty"
)
(
nonascii-translation
.
cyrillic-iso8859-5
)
(
unibyte-display
.
cyrillic-iso-8bit
)
(
features
cyril-util
)
(
sample-text
.
"Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!"
)
...
...
@@ -58,91 +57,24 @@
;; KOI-8 staff
(
defvar
cyrillic-koi8-r-decode-table
[
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
?
,
Lq
(
B
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
?
,
L!
(
B
180
181
182
183
184
185
186
187
188
189
190
191
?
,
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
?
,
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
?
,
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
?
,
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
]
"Cyrillic KOI8-R decoding table."
)
(
let
((
table
(
make-translation-table-from-vector
cyrillic-koi8-r-decode-table
)))
(
define-translation-table
'cyrillic-koi8-r-nonascii-translation-table
table
)
(
define-translation-table
'cyrillic-koi8-r-encode-table
(
char-table-extra-slot
table
0
)))
(
define-ccl-program
ccl-decode-koi8
`
(
3
((
loop
(
r0
=
0
)
(
read
r1
)
(
if
(
r1
<
128
)
(
write-repeat
r1
)
((
translate-character
cyrillic-koi8-r-nonascii-translation-table
r0
r1
)
(
write-multibyte-character
r0
r1
)
(
repeat
))))))
"CCL program to decode KOI8."
)
(
define-ccl-program
ccl-encode-koi8
`
(
1
((
loop
(
read-multibyte-character
r0
r1
)
(
if
(
r0
==
,
(
charset-id
'cyrillic-iso8859-5
))
(
translate-character
cyrillic-koi8-r-encode-table
r0
r1
))
(
write-repeat
r1
))))
"CCL program to encode KOI8."
)
(
make-coding-system
'cyrillic-koi8
4
;; We used to use ?K. It is true that ?K is more strictly correct,
;; but it is also used for Korean.
;; So people who use koi8 for languages other than Russian
;; will have to forgive us.
?R
"KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)."
'
(
ccl-decode-koi8
.
ccl-encode-koi8
)
`
((
safe-chars
.
,
(
let
((
table
(
make-char-table
'safe-chars
))
(
i
0
))
(
while
(
<
i
256
)
(
aset
table
(
aref
cyrillic-koi8-r-decode-table
i
)
t
)
(
setq
i
(
1+
i
)))
table
))
(
mime-charset
.
koi8-r
)
(
valid-codes
(
0
.
127
)
163
179
(
192
.
255
))
(
charset-origin-alist
(
cyrillic-iso8859-5
"KOI8-R"
cyrillic-encode-koi8-r-char
))))
(
define-coding-system
'cyrillic-koi8
"KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)."
:coding-type
'charset
;; We used to use ?K. It is true that ?K is more strictly correct,
;; but it is also used for Korean. So people who use koi8 for
;; languages other than Russian will have to forgive us.
:mnemonic
?R
:charset-list
'
(
koi8
)
:plist
'
(
mime-charset
koi8-r
))
(
define-coding-system-alias
'koi8-r
'cyrillic-koi8
)
(
define-coding-system-alias
'koi8
'cyrillic-koi8
)
(
define-ccl-program
ccl-encode-koi8-font
`
(
0
((
translate-character
cyrillic-koi8-r-encode-table
r0
r1
)))
"CCL program to encode Cyrillic chars to KOI font."
)
(
setq
font-ccl-encoder-alist
(
cons
'
(
"koi8"
.
ccl-encode-koi8-font
)
font-ccl-encoder-alist
))
(
set-language-info-alist
"Cyrillic-KOI8"
`
((
charset
cyrillic-iso8859-5
)
(
nonascii-translation
.
,
(
get
'cyrillic-koi8-r-nonascii-translation-table
'translation-table
))
"Cyrillic-KOI8"
`
((
charset
koi8
)
(
coding-system
cyrillic-koi8
)
(
coding-priority
cyrillic-koi8
)
(
nonascii-translation
.
koi8
)
(
input-method
.
"cyrillic-jcuken"
)
(
features
cyril-util
)
(
unibyte-display
.
cyrillic-koi8
)
...
...
@@ -152,89 +84,19 @@
;;; ALTERNATIVNYJ staff
(
defvar
cyrillic-alternativnyj-decode-table
[
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
?
,
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
?
,
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
?
,
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
?
,
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
?
,
L!
(
B
?
,
Lq
(
B
242
243
244
245
246
247
248
249
250
251
252
253
254
?
,
Lp
(
B]
"Cyrillic ALTERNATIVNYJ decoding table."
)
(
let
((
table
(
make-translation-table-from-vector
cyrillic-alternativnyj-decode-table
)))
(
define-translation-table
'cyrillic-alternativnyj-nonascii-translation-table
table
)
(
define-translation-table
'cyrillic-alternativnyj-encode-table
(
char-table-extra-slot
table
0
)))
(
define-ccl-program
ccl-decode-alternativnyj
`
(
3
((
loop
(
r0
=
0
)
(
read
r1
)
(
if
(
r1
<
128
)
(
write-repeat
r1
)
((
translate-character
cyrillic-alternativnyj-nonascii-translation-table
r0
r1
)
(
write-multibyte-character
r0
r1
)
(
repeat
))))))
"CCL program to decode Alternativnyj."
)
(
define-ccl-program
ccl-encode-alternativnyj
`
(
1
((
loop
(
read-multibyte-character
r0
r1
)
(
translate-character
cyrillic-alternativnyj-encode-table
r0
r1
)
(
write-repeat
r1
))))
"CCL program to encode Alternativnyj."
)
(
make-coding-system
'cyrillic-alternativnyj
4
?A
"ALTERNATIVNYJ 8-bit encoding for Cyrillic."
'
(
ccl-decode-alternativnyj
.
ccl-encode-alternativnyj
)
`
((
safe-chars
.
,
(
let
((
table
(
make-char-table
'safe-chars
))
(
i
0
))
(
while
(
<
i
256
)
(
aset
table
(
aref
cyrillic-alternativnyj-decode-table
i
)
t
)
(
setq
i
(
1+
i
)))
table
))
(
valid-codes
(
0
.
175
)
(
224
.
241
)
255
)
(
charset-origin-alist
(
cyrillic-iso8859-5
"ALTERNATIVNYJ"
cyrillic-encode-koi8-r-char
))))
(
define-coding-system
'cyrillic-alternativnyj
"ALTERNATIVNYJ 8-bit encoding for Cyrillic."
:coding-type
'charset
:mnemonic
?A
:charset-list
'
(
alternativnyj
))
(
define-coding-system-alias
'alternativnyj
'cyrillic-alternativnyj
)
(
define-ccl-program
ccl-encode-alternativnyj-font
'
(
0
((
translate-character
cyrillic-alternativnyj-encode-table
r0
r1
)))
"CCL program to encode Cyrillic chars to Alternativnyj font."
)
(
setq
font-ccl-encoder-alist
(
cons
'
(
"alternativnyj"
.
ccl-encode-alternativnyj-font
)
font-ccl-encoder-alist
))
(
set-language-info-alist
"Cyrillic-ALT"
`
((
charset
cyrillic-iso8859-5
)
(
nonascii-translation
.
,
(
get
'cyrillic-alternativnyj-nonascii-translation-table
'translation-table
))
"Cyrillic-ALT"
`
((
charset
alternativnyj
)
(
coding-system
cyrillic-alternativnyj
)
(
coding-priority
cyrillic-alternativnyj
)
(
nonascii-translation
.
alternativnyj
)
(
input-method
.
"cyrillic-jcuken"
)
(
features
cyril-util
)
(
unibyte-display
.
cyrillic-alternativnyj
)
...
...
lisp/language/european.el
View file @
e1915ab3
...
...
@@ -32,22 +32,11 @@
;; Latin-1 (ISO-8859-1)
(
make-coding-system
'iso-latin-1
2
?1
"ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)."
'
(
ascii
latin-iso8859-1
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
t
)
'
((
safe-charsets
ascii
latin-iso8859-1
)
(
mime-charset
.
iso-8859-1
)))
(
define-coding-system-alias
'iso-8859-1
'iso-latin-1
)
(
define-coding-system-alias
'latin-1
'iso-latin-1
)
(
set-language-info-alist
"Latin-1"
'
((
charset
ascii
latin-
iso8859-1
)
"Latin-1"
'
((
charset
iso
-
8859-1
)
(
coding-system
iso-latin-1
)
(
coding-priority
iso-latin-1
)
(
nonascii-translation
.
latin-
iso8859-1
)
(
nonascii-translation
.
iso
-
8859-1
)
(
unibyte-syntax
.
"latin-1"
)
(
unibyte-display
.
iso-latin-1
)
(
input-method
.
"latin-1-prefix"
)
...
...
@@ -74,22 +63,21 @@ Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
;; Latin-2 (ISO-8859-2)
(make-coding-system
'iso-latin-2 2 ?2
"
ISO
2022
based
8-bit
encoding
for
Latin-2
(
MIME:ISO-8859-2
)
.
"
'(ascii latin-iso8859-2 nil nil
nil nil nil nil nil nil nil)
'((safe-charsets ascii latin-iso8859-2)
(mime-charset . iso-8859-2)))
(define-coding-system 'iso-latin-2
"
ISO
2022
based
8-bit
encoding
for
Latin-2
(
MIME:ISO-8859-2
)
.
"
:coding-type 'charset
:mnemonic ?2
:charset-list '(iso-8859-2)
:plist '(mime-charset iso-8859-2))
(define-coding-system-alias 'iso-8859-2 'iso-latin-2)
(define-coding-system-alias 'latin-2 'iso-latin-2)
(set-language-info-alist
"
Latin-2
" '((charset
ascii latin-
iso8859-2)
"
Latin-2
" '((charset iso
-
8859-2)
(coding-system iso-latin-2)
(coding-priority iso-latin-2)
(nonascii-translation .
latin-
iso8859-2)
(nonascii-translation . iso
-
8859-2)
(unibyte-syntax . "
latin-2
")
(unibyte-display . iso-latin-2)
(input-method . "
latin-2-prefix
")
...
...
@@ -108,22 +96,21 @@ We also have specific language environments for the following languages:
;; Latin-3 (ISO-8859-3)
(make-coding-system