Mercurial > emacs
annotate lisp/language/vietnamese.el @ 42890:05f254304877
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 22 Jan 2002 01:09:23 +0000 |
parents | e3ae5ef41293 |
children | 39ed2c52ffb0 fad0f879877f |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
33778
diff
changeset
|
1 ;;; vietnamese.el --- support for Vietnamese -*- coding: iso-2022-7bit; -*- |
17052 | 2 |
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
18377
8b4a66c66dd6
Change copyright notice.
Richard M. Stallman <rms@gnu.org>
parents:
18309
diff
changeset
|
4 ;; Licensed to the Free Software Foundation. |
17052 | 5 |
6 ;; Keywords: multilingual, Vietnamese | |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
17071 | 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
17052 | 24 |
25 ;;; Commentary: | |
26 | |
27 ;; For Vietnames, the character sets VISCII and VSCII are supported. | |
28 | |
29 ;;; Code: | |
30 | |
31 (defvar viet-viscii-decode-table | |
32 [;; VISCII is a full 8-bit code. | |
33 0 1 ?,2F(B 3 4 ?,2G(B ?,2g(B 7 8 9 10 11 12 13 14 15 | |
34 16 17 18 19 ?,2V(B 21 22 23 24 ?,2[(B 26 27 28 29 ?,2\(B 31 | |
35 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
36 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
37 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
38 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
39 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
40 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
41 ?,2U(B ?,2!(B ?,2"(B ?,2#(B ?,2$(B ?,2%(B ?,2&(B ?,2'(B ?,2((B ?,2)(B ?,2*(B ?,2+(B ?,2,(B ?,2-(B ?,2.(B ?,2/(B | |
42 ?,20(B ?,21(B ?,22(B ?,25(B ?,2~(B ?,2>(B ?,26(B ?,27(B ?,28(B ?,2v(B ?,2w(B ?,2o(B ?,2|(B ?,2{(B ?,2x(B ?,2O(B | |
43 ?,2u(B ?,1!(B ?,1"(B ?,1#(B ?,1$(B ?,1%(B ?,1&(B ?,1'(B ?,1((B ?,1)(B ?,1*(B ?,1+(B ?,1,(B ?,1-(B ?,1.(B ?,1/(B | |
44 ?,10(B ?,11(B ?,12(B ?,2^(B ?,2=(B ?,15(B ?,16(B ?,17(B ?,18(B ?,2q(B ?,2Q(B ?,2W(B ?,2X(B ?,1=(B ?,1>(B ?,2_(B | |
45 ?,2`(B ?,2a(B ?,2b(B ?,2c(B ?,2d(B ?,2e(B ?,1F(B ?,1G(B ?,2h(B ?,2i(B ?,2j(B ?,2k(B ?,2l(B ?,2m(B ?,2n(B ?,1O(B | |
46 ?,2p(B ?,1Q(B ?,2r(B ?,2s(B ?,2t(B ?,1U(B ?,1V(B ?,1W(B ?,1X(B ?,2y(B ?,2z(B ?,1[(B ?,1\(B ?,2}(B ?,1^(B ?,1_(B | |
47 ?,1`(B ?,1a(B ?,1b(B ?,1c(B ?,1d(B ?,1e(B ?,1f(B ?,1g(B ?,1h(B ?,1i(B ?,1j(B ?,1k(B ?,1l(B ?,1m(B ?,1n(B ?,1o(B | |
48 ?,1p(B ?,1q(B ?,1r(B ?,1s(B ?,1t(B ?,1u(B ?,1v(B ?,1w(B ?,1x(B ?,1y(B ?,1z(B ?,1{(B ?,1|(B ?,1}(B ?,1~(B ?,2f(B ] | |
22879
33987189baf3
(viet-viscii-decode-table): Docstring
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
49 "Vietnamese VISCII decoding table.") |
17052 | 50 |
29452 | 51 (let ((table (make-translation-table-from-vector viet-viscii-decode-table))) |
52 (define-translation-table 'viet-viscii-nonascii-translation-table table) | |
53 (define-translation-table 'viet-viscii-encode-table | |
54 (char-table-extra-slot table 0))) | |
17052 | 55 |
56 (defvar viet-vscii-decode-table | |
57 [;; VSCII is a full 8-bit code. | |
58 0 ?,2z(B ?,2x(B 3 ?,2W(B ?,2X(B ?,2f(B 7 8 9 10 11 12 13 14 15 | |
59 16 ?,2Q(B ?,2_(B ?,2O(B ?,2V(B ?,2[(B ?,2}(B ?,2\(B 24 25 26 27 28 29 30 31 | |
60 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
61 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
62 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
63 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
64 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
65 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
66 ?,2`(B ?,2d(B ?,2c(B ?,2a(B ?,2U(B ?,2#(B ?,2'(B ?,2h(B ?,2k(B ?,2((B ?,2i(B ?,2)(B ?,2.(B ?,2l(B ?,2o(B ?,2n(B | |
67 ?,2m(B ?,28(B ?,2r(B ?,2v(B ?,2u(B ?,2s(B ?,2w(B ?,25(B ?,26(B ?,27(B ?,2^(B ?,2>(B ?,2~(B ?,2y(B ?,2|(B ?,2{(B | |
28536
fd56586afd85
(viet-vscii-decode-table): Fix a bug.
Kenichi Handa <handa@m17n.org>
parents:
24808
diff
changeset
|
68 160 ?,2e(B ?,2b(B ?,2j(B ?,2t(B ?,2=(B ?,2_(B ?,2p(B ?,1e(B ?,1b(B ?,1j(B ?,1t(B ?,1=(B ?,1y(B ?,1p(B ?,2"(B |
17052 | 69 192 193 194 195 196 ?,1`(B ?,1d(B ?,1c(B ?,1a(B ?,1U(B ?,2F(B ?,1"(B ?,1F(B ?,1G(B ?,1!(B ?,2G(B |
70 ?,2!(B ?,2%(B ?,2&(B ?,2g(B ?,2%(B ?,2+(B ?,1#(B ?,1%(B ?,1&(B ?,1g(B ?,1$(B ?,1'(B ?,1h(B ?,2,(B ?,1k(B ?,1((B | |
71 ?,1i(B ?,1)(B ?,1+(B ?,1,(B ?,1-(B ?,1*(B ?,1.(B ?,1l(B ?,1o(B ?,2-(B ?,2*(B ?,20(B ?,1n(B ?,1m(B ?,18(B ?,1r(B | |
72 ?,21(B ?,1v(B ?,1u(B ?,1s(B ?,1w(B ?,10(B ?,11(B ?,12(B ?,1/(B ?,15(B ?,16(B ?,17(B ?,1^(B ?,1>(B ?,1~(B ?,1y(B | |
73 ?,22(B ?,1|(B ?,1{(B ?,1z(B ?,1x(B ?,1W(B ?,1X(B ?,1f(B ?,1Q(B ?,1q(B ?,1O(B ?,1V(B ?,1[(B ?,1}(B ?,1\(B ?,2/(B] | |
22879
33987189baf3
(viet-viscii-decode-table): Docstring
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
74 "Vietnamese VSCII decoding table.") |
17052 | 75 |
29452 | 76 (let ((table (make-translation-table-from-vector viet-vscii-decode-table))) |
77 (define-translation-table 'viet-vscii-nonascii-translation-table table) | |
78 (define-translation-table 'viet-vscii-encode-table | |
79 (char-table-extra-slot table 0))) | |
17052 | 80 |
81 (define-ccl-program ccl-decode-viscii | |
82 `(3 | |
29452 | 83 ((loop |
84 (r0 = 0) | |
85 (read r1) | |
86 (translate-character viet-viscii-nonascii-translation-table r0 r1) | |
87 (write-multibyte-character r0 r1) | |
88 (repeat)))) | |
17052 | 89 "CCL program to decode VISCII 1.1") |
90 | |
91 (define-ccl-program ccl-encode-viscii | |
92 `(1 | |
29452 | 93 ((loop |
94 (read-multibyte-character r0 r1) | |
95 (translate-character viet-viscii-encode-table r0 r1) | |
96 (write-repeat r1)))) | |
17052 | 97 "CCL program to encode VISCII 1.1") |
98 | |
99 (define-ccl-program ccl-encode-viscii-font | |
100 `(0 | |
101 ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper | |
102 ;; R1:position code | |
103 ;; Out: R1:font code point | |
29452 | 104 (translate-character viet-viscii-encode-table r0 r1)) |
17052 | 105 "CCL program to encode Vietnamese chars to VISCII 1.1 font") |
106 | |
107 (define-ccl-program ccl-decode-vscii | |
108 `(3 | |
29452 | 109 ((loop |
110 (r0 = 0) | |
111 (read r1) | |
112 (translate-character viet-vscii-nonascii-translation-table r0 r1) | |
113 (write-multibyte-character r0 r1) | |
114 (repeat)))) | |
17052 | 115 "CCL program to decode VSCII-1.") |
116 | |
117 (define-ccl-program ccl-encode-vscii | |
118 `(1 | |
29452 | 119 ((loop |
120 (read-multibyte-character r0 r1) | |
121 (translate-character viet-vscii-encode-table r0 r1) | |
122 (write-repeat r1)))) | |
17052 | 123 "CCL program to encode VSCII-1.") |
124 | |
125 (define-ccl-program ccl-encode-vscii-font | |
126 `(0 | |
127 ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper | |
128 ;; R1:position code | |
129 ;; Out: R1:font code point | |
29452 | 130 (translate-character viet-vscii-encode-table r0 r1)) |
17052 | 131 "CCL program to encode Vietnamese chars to VSCII-1 font.") |
132 | |
133 | |
134 (make-coding-system | |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
17993
diff
changeset
|
135 'vietnamese-viscii 4 ?V |
42152 | 136 "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)." |
21663
a03ddc4a728b
FLAGS arguments for make-coding-system changed.
Kenichi Handa <handa@m17n.org>
parents:
20739
diff
changeset
|
137 '(ccl-decode-viscii . ccl-encode-viscii) |
20739
5f2c7f919bbf
Adjusted for the change of make-coding-system. Register
Kenichi Handa <handa@m17n.org>
parents:
20155
diff
changeset
|
138 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) |
22879
33987189baf3
(viet-viscii-decode-table): Docstring
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
139 (mime-charset . viscii) |
23069
96139be23b05
(vietnamese-viscii): Fix the value of
Kenichi Handa <handa@m17n.org>
parents:
22983
diff
changeset
|
140 (valid-codes (0 . 255)))) |
17052 | 141 |
18519
b6badf3614ea
Fix calls to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18377
diff
changeset
|
142 (define-coding-system-alias 'viscii 'vietnamese-viscii) |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
17993
diff
changeset
|
143 |
17052 | 144 (make-coding-system |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
17993
diff
changeset
|
145 'vietnamese-vscii 4 ?v |
42152 | 146 "8-bit encoding for Vietnamese VSCII-1." |
21663
a03ddc4a728b
FLAGS arguments for make-coding-system changed.
Kenichi Handa <handa@m17n.org>
parents:
20739
diff
changeset
|
147 '(ccl-decode-vscii . ccl-encode-vscii) |
22879
33987189baf3
(viet-viscii-decode-table): Docstring
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
148 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) |
23069
96139be23b05
(vietnamese-viscii): Fix the value of
Kenichi Handa <handa@m17n.org>
parents:
22983
diff
changeset
|
149 (valid-codes (0 . 255)))) |
17052 | 150 |
18519
b6badf3614ea
Fix calls to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18377
diff
changeset
|
151 (define-coding-system-alias 'vscii 'vietnamese-vscii) |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
17993
diff
changeset
|
152 |
17052 | 153 (make-coding-system |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
17993
diff
changeset
|
154 'vietnamese-viqr 0 ?q |
42152 | 155 "Encoding for Vietnamese latin transcription (VIQR)." |
20155
d74c1bd094a2
Give proper SAFE-CHARSET argument in
Kenichi Handa <handa@m17n.org>
parents:
20108
diff
changeset
|
156 nil |
20739
5f2c7f919bbf
Adjusted for the change of make-coding-system. Register
Kenichi Handa <handa@m17n.org>
parents:
20155
diff
changeset
|
157 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) |
5f2c7f919bbf
Adjusted for the change of make-coding-system. Register
Kenichi Handa <handa@m17n.org>
parents:
20155
diff
changeset
|
158 (post-read-conversion . viqr-post-read-conversion) |
24296
28d942c5d967
(vietnamese-viqr): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents:
23158
diff
changeset
|
159 (pre-write-conversion . viqr-pre-write-conversion) |
28d942c5d967
(vietnamese-viqr): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents:
23158
diff
changeset
|
160 (charset-origin-alist |
28d942c5d967
(vietnamese-viqr): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents:
23158
diff
changeset
|
161 (vietnamese-viscii-lower "VISCII" viet-encode-viscii-char) |
28d942c5d967
(vietnamese-viqr): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents:
23158
diff
changeset
|
162 (vietnamese-viscii-upper "VISCII" viet-encode-viscii-char)))) |
28d942c5d967
(vietnamese-viqr): Add charset-origin-alist property.
Kenichi Handa <handa@m17n.org>
parents:
23158
diff
changeset
|
163 |
18203
0745f30aec66
Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents:
17993
diff
changeset
|
164 |
18519
b6badf3614ea
Fix calls to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents:
18377
diff
changeset
|
165 (define-coding-system-alias 'viqr 'vietnamese-viqr) |
17052 | 166 |
167 (setq font-ccl-encoder-alist | |
29452 | 168 (cons '("viscii" . ccl-encode-viscii-font) font-ccl-encoder-alist)) |
17052 | 169 |
170 (setq font-ccl-encoder-alist | |
29452 | 171 (cons '("vscii" . ccl-encode-vscii-font) font-ccl-encoder-alist)) |
22879
33987189baf3
(viet-viscii-decode-table): Docstring
Kenichi Handa <handa@m17n.org>
parents:
21663
diff
changeset
|
172 |
17052 | 173 (set-language-info-alist |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22879
diff
changeset
|
174 "Vietnamese" `((charset vietnamese-viscii-lower vietnamese-viscii-upper) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22879
diff
changeset
|
175 (nonascii-translation |
29452 | 176 . ,(get 'viet-viscii-nonascii-translation-table |
177 'translation-table)) | |
20739
5f2c7f919bbf
Adjusted for the change of make-coding-system. Register
Kenichi Handa <handa@m17n.org>
parents:
20155
diff
changeset
|
178 (coding-system vietnamese-viscii vietnamese-vscii |
5f2c7f919bbf
Adjusted for the change of make-coding-system. Register
Kenichi Handa <handa@m17n.org>
parents:
20155
diff
changeset
|
179 vietnamese-viqr) |
5f2c7f919bbf
Adjusted for the change of make-coding-system. Register
Kenichi Handa <handa@m17n.org>
parents:
20155
diff
changeset
|
180 (coding-priority vietnamese-viscii) |
22983
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22879
diff
changeset
|
181 (input-method . "vietnamese-viqr") |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22879
diff
changeset
|
182 (unibyte-display . vietnamese-viscii) |
7a010b8c0d99
("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents:
22879
diff
changeset
|
183 (features viet-util) |
17772
550afdbb31d8
Make functions setup-LANGUAGE-environment
Kenichi Handa <handa@m17n.org>
parents:
17170
diff
changeset
|
184 (sample-text . "Vietnamese (Ti,1*(Bng Vi,1.(Bt) Ch,1`(Bo b,1U(Bn") |
17993
73869115ae0a
Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents:
17841
diff
changeset
|
185 (documentation . "\ |
42152 | 186 For Vietnamese, Emacs uses special character sets internally. |
187 They can be decoded from and encoded to VISCII, VSCII, and VIQR. | |
20739
5f2c7f919bbf
Adjusted for the change of make-coding-system. Register
Kenichi Handa <handa@m17n.org>
parents:
20155
diff
changeset
|
188 Current setting put higher priority to the coding system VISCII than VSCII. |
5f2c7f919bbf
Adjusted for the change of make-coding-system. Register
Kenichi Handa <handa@m17n.org>
parents:
20155
diff
changeset
|
189 If you prefer VSCII, please do: (prefer-coding-system 'vietnamese-vscii)") |
17841
084d922fcd78
Coding system names changed as follows:
Kenichi Handa <handa@m17n.org>
parents:
17772
diff
changeset
|
190 )) |
17052 | 191 |
33778 | 192 (provide 'vietnamese) |
193 | |
17052 | 194 ;;; vietnamese.el ends here |