Mercurial > emacs
annotate lisp/international/characters.el @ 18050:506b35a4537e
Initial revision
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 31 May 1997 00:34:13 +0000 |
parents | de6be7f3b904 |
children | 90235db802c7 |
rev | line source |
---|---|
17052 | 1 ;;; characters.el --- set syntax and category for multibyte characters |
2 | |
3 ;; Copyright (C) 1995 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
5 | |
6 ;; Keywords: multibyte character, character set, syntax, category | |
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 ;; This file contains multibyte characters. Save this file always in | |
17078
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
28 ;; the coding system `iso-2022-7'. |
17052 | 29 |
30 ;;; Predefined categories. | |
31 | |
32 ;; For each character set. | |
33 | |
34 (define-category ?a "ASCII") | |
35 (define-category ?l "Latin") | |
36 (define-category ?t "Thai") | |
37 (define-category ?g "Greek") | |
38 (define-category ?b "Arabic") | |
39 (define-category ?w "Hebrew") | |
40 (define-category ?y "Cyrillic") | |
41 (define-category ?k "Japanese katakana") | |
42 (define-category ?r "Japanese roman") | |
43 (define-category ?c "Chinese") | |
44 (define-category ?j "Japanese") | |
45 (define-category ?h "Korean") | |
46 (define-category ?e "Ethiopic (Ge'ez)") | |
47 (define-category ?v "Vietnamese") | |
48 (define-category ?i "Indian") | |
17078
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
49 (define-category ?o "Lao") |
17753
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
50 (define-category ?q "Tibetan") |
17052 | 51 |
52 ;; For each group (row) of 2-byte character sets. | |
53 | |
54 (define-category ?A "Alpha numeric characters of 2-byte character sets") | |
55 (define-category ?C "Chinese (Han) characters of 2-byte character sets") | |
56 (define-category ?G "Greek characters of 2-byte characters sets") | |
57 (define-category ?H "Japanese Hiragana characters of 2-byte character sets") | |
58 (define-category ?K "Japanese Katakana characters of 2-byte character sets") | |
59 (define-category ?N "Korean Hangul characters of 2-byte character sets") | |
60 (define-category ?Y "Cyrillic character of 2-byte character sets") | |
61 (define-category ?I "Indian Glyphs") | |
62 | |
63 ;; For phonetic classifications. | |
64 | |
65 (define-category ?0 "consonant") | |
66 (define-category ?1 "base vowel") | |
67 (define-category ?2 "upper diacritical mark (including upper vowel)") | |
68 (define-category ?3 "lower diacritical mark (including lower vowel)") | |
69 (define-category ?4 "tone mark") | |
70 (define-category ?5 "vowel") | |
71 (define-category ?6 "digit") | |
72 (define-category ?7 "vowel-modifying diacritical mark") | |
17078
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
73 (define-category ?8 "vowel-signs") |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
74 (define-category ?9 "semivowel lower") |
17052 | 75 |
76 ;; For filling. | |
77 (define-category ?| "While filling, we can break a line at this character.") | |
78 | |
79 ;; Keep the followings for `kinsoku' processing. See comments in | |
80 ;; kinsoku.el. | |
81 (define-category ?> "A character which can't be placed at beginning of line.") | |
82 (define-category ?< "A character which can't be placed at end of line.") | |
83 | |
84 | |
85 ;;; Setting syntax and category. | |
86 | |
87 ;; ASCII | |
88 | |
89 (let ((ch 32)) | |
90 (while (< ch 127) ; All ASCII characters have | |
91 (modify-category-entry ch ?a) ; the category `a' (ASCII) | |
92 (modify-category-entry ch ?l) ; and `l' (Latin). | |
93 (setq ch (1+ ch)))) | |
94 | |
95 ;; Arabic character set | |
96 | |
97 (let ((charsets '(arabic-iso8859-6 | |
98 arabic-digit | |
99 arabic-1-column | |
100 arabic-2-column))) | |
101 (while charsets | |
102 (modify-syntax-entry (make-char (car charsets)) "w") | |
103 (modify-category-entry (make-char (car charsets)) ?b) | |
104 (setq charsets (cdr charsets)))) | |
105 | |
106 ;; Chinese character set (GB2312) | |
107 | |
108 (modify-syntax-entry (make-char 'chinese-gb2312) "w") | |
109 (modify-syntax-entry (make-char 'chinese-gb2312 33) "_") | |
110 (modify-syntax-entry (make-char 'chinese-gb2312 34) "_") | |
111 (modify-syntax-entry (make-char 'chinese-gb2312 41) "_") | |
112 (modify-syntax-entry ?\$A!2(B "($A!3(B") | |
113 (modify-syntax-entry ?\$A!4(B "($A!5(B") | |
114 (modify-syntax-entry ?\$A!6(B "($A!7(B") | |
115 (modify-syntax-entry ?\$A!8(B "($A!9(B") | |
116 (modify-syntax-entry ?\$A!:(B "($A!;(B") | |
117 (modify-syntax-entry ?\$A!<(B "($A!=(B") | |
118 (modify-syntax-entry ?\$A!>(B "($A!?(B") | |
119 (modify-syntax-entry ?\$A!3(B ")$A!2(B") | |
120 (modify-syntax-entry ?\$A!5(B ")$A!4(B") | |
121 (modify-syntax-entry ?\$A!7(B ")$A!6(B") | |
122 (modify-syntax-entry ?\$A!9(B ")$A!8(B") | |
123 (modify-syntax-entry ?\$A!;(B ")$A!:(B") | |
124 (modify-syntax-entry ?\$A!=(B ")$A!<(B") | |
125 (modify-syntax-entry ?\$A!?(B ")$A!>(B") | |
126 | |
127 (modify-category-entry (make-char 'chinese-gb2312) ?c) | |
128 (modify-category-entry (make-char 'chinese-gb2312) ?\|) | |
129 (modify-category-entry (make-char 'chinese-gb2312 35) ?A) | |
130 (modify-category-entry (make-char 'chinese-gb2312 36) ?H) | |
131 (modify-category-entry (make-char 'chinese-gb2312 37) ?K) | |
132 (modify-category-entry (make-char 'chinese-gb2312 38) ?G) | |
133 (modify-category-entry (make-char 'chinese-gb2312 39) ?Y) | |
134 (modify-category-entry (make-char 'chinese-gb2312 35) ?A) | |
135 (let ((row 48)) | |
136 (while (< row 127) | |
137 (modify-category-entry (make-char 'chinese-gb2312 row) ?C) | |
138 (setq row (1+ row)))) | |
139 | |
140 ;; Chinese character set (BIG5) | |
141 | |
142 (let ((generic-big5-1-char (make-char 'chinese-big5-1)) | |
143 (generic-big5-2-char (make-char 'chinese-big5-2))) | |
144 (modify-syntax-entry generic-big5-1-char "w") | |
145 (modify-syntax-entry generic-big5-2-char "w") | |
146 | |
147 (modify-category-entry generic-big5-1-char ?c) | |
148 (modify-category-entry generic-big5-2-char ?c) | |
149 | |
150 (modify-category-entry generic-big5-1-char ?C) | |
151 (modify-category-entry generic-big5-2-char ?C) | |
152 | |
153 (modify-category-entry generic-big5-1-char ?\|) | |
154 (modify-category-entry generic-big5-2-char ?\|)) | |
155 | |
156 | |
157 ;; Chinese character set (CNS11643) | |
158 | |
159 (let ((cns-list '(chinese-cns11643-1 | |
160 chinese-cns11643-2 | |
161 chinese-cns11643-3 | |
162 chinese-cns11643-4 | |
163 chinese-cns11643-5 | |
164 chinese-cns11643-6 | |
165 chinese-cns11643-7)) | |
166 generic-char) | |
167 (while cns-list | |
168 (setq generic-char (make-char (car cns-list))) | |
169 (modify-syntax-entry generic-char "w") | |
170 (modify-category-entry generic-char ?c) | |
171 (modify-category-entry generic-char ?C) | |
172 (modify-category-entry generic-char ?|) | |
173 (setq cns-list (cdr cns-list)))) | |
174 | |
175 ;; Cyrillic character set (ISO-8859-5) | |
176 | |
177 (modify-category-entry (make-char 'cyrillic-iso8859-5) ?y) | |
178 | |
179 (let ((c 160)) | |
180 (while (< c 256) | |
181 (modify-syntax-entry (make-char 'cyrillic-iso8859-5 c) "w") | |
182 (setq c (1+ c)))) | |
183 (modify-syntax-entry ?,L-(B ".") | |
184 (modify-syntax-entry ?,Lp(B ".") | |
185 (modify-syntax-entry ?,L}(B ".") | |
186 | |
17753
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
187 ;; Devanagari character set |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
188 |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
189 (let ((deflist '(;; chars syntax category |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
190 ("$(5!!!"!#(B" "w" ?7) ; vowel-modifying diacritical mark |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
191 ; chandrabindu, anuswar, visarga |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
192 ("$(5!$(B-$(5!2(B" "w" ?5) ; independent vowel |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
193 ("$(5!3(B-$(5!X(B" "w" ?0) ; consonant |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
194 ("$(5!Z(B-$(5!g(B" "w" ?8) ; matra |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
195 ("$(5!q(B-$(5!z(B" "w" ?6) ; digit |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
196 )) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
197 elm chars len syntax category to ch i) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
198 (while deflist |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
199 (setq elm (car deflist)) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
200 (setq chars (car elm) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
201 len (length chars) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
202 syntax (nth 1 elm) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
203 category (nth 2 elm) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
204 i 0) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
205 (while (< i len) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
206 (if (= (aref chars i) ?-) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
207 (setq i (1+ i) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
208 to (sref chars i)) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
209 (setq ch (sref chars i) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
210 to ch)) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
211 (while (<= ch to) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
212 (modify-syntax-entry ch syntax) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
213 (modify-category-entry ch category) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
214 (setq ch (1+ ch))) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
215 (setq i (+ i (char-bytes to)))) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
216 (setq deflist (cdr deflist)))) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
217 |
17052 | 218 ;; Ethiopic character set |
219 | |
220 (modify-category-entry (make-char 'ethiopic) ?e) | |
221 | |
222 ;; European character set (Latin-1,2,3,4,5) | |
223 | |
224 (modify-category-entry (make-char 'latin-iso8859-1) ?l) | |
225 (modify-category-entry (make-char 'latin-iso8859-2) ?l) | |
226 (modify-category-entry (make-char 'latin-iso8859-3) ?l) | |
227 (modify-category-entry (make-char 'latin-iso8859-4) ?l) | |
228 (modify-category-entry (make-char 'latin-iso8859-9) ?l) | |
229 | |
230 ;; ISO-8859-1 (Latin-1) | |
231 (let ((c 64)) | |
232 (while (< c 128) ; from ',A@(B' to ',A(B' | |
233 (modify-syntax-entry (make-char 'latin-iso8859-1 c) "w") | |
234 (setq c (1+ c))) | |
235 (modify-syntax-entry (make-char 'latin-iso8859-1 32) "w") ; NBSP | |
236 (modify-syntax-entry ?,AW(B "_") | |
237 (modify-syntax-entry ?,Aw(B "_") | |
238 ) | |
239 | |
240 ;; ISO-8859-2 (Latin-2) | |
241 (let ((c 190)) | |
242 (while (< c 255) | |
243 (modify-syntax-entry (make-char 'latin-iso8859-2 c) "w") | |
244 (setq c (1+ c)))) | |
245 (let ((chars '(?,B!(B ?,B#(B ?,B%(B ?,B&(B ?,B)(B ?,B*(B ?,B+(B ?,B,(B ?,B.(B ?,B/(B ?,B1(B ?,B3(B ?,B5(B ?,B6(B ?,B9(B ?,B:(B ?,B;(B ?,B<(B))) | |
246 (while chars | |
247 (modify-syntax-entry (car chars) "w") | |
248 (setq chars (cdr chars)))) | |
249 (modify-syntax-entry (make-char 'latin-iso8859-2 160) "w") ; NBSP | |
250 (modify-syntax-entry ?,BW(B ".") | |
251 (modify-syntax-entry ?,Bw(B ".") | |
252 | |
253 ;; Greek character set (ISO-8859-7) | |
254 | |
255 (modify-category-entry (make-char 'greek-iso8859-7) ?g) | |
256 | |
257 (let ((c 182)) | |
258 (while (< c 255) | |
259 (modify-syntax-entry (make-char 'greek-iso8859-7 c) "w") | |
260 (setq c (1+ c)))) | |
261 (modify-syntax-entry (make-char 'greek-iso8859-7 160) "w") ; NBSP | |
262 (modify-syntax-entry ?,F7(B ".") | |
263 (modify-syntax-entry ?,F;(B ".") | |
264 (modify-syntax-entry ?,F=(B ".") | |
265 | |
266 ;; Hebrew character set (ISO-8859-8) | |
267 | |
268 (modify-category-entry (make-char 'hebrew-iso8859-8) ?w) | |
269 | |
270 (let ((c 224)) | |
271 (while (< c 251) | |
272 (modify-syntax-entry (make-char 'hebrew-iso8859-8 c) "w") | |
273 (setq c (1+ c)))) | |
274 (modify-syntax-entry (make-char 'hebrew-iso8859-8 160) "w") ; NBSP | |
275 | |
276 ;; Indian character set (IS 13194 and other Emacs original Indian charsets) | |
277 | |
278 (modify-category-entry (make-char 'indian-is13194) ?i) | |
279 (modify-category-entry (make-char 'indian-2-column) ?I) | |
280 (modify-category-entry (make-char 'indian-1-column) ?I) | |
281 | |
282 ;; Japanese character set (JISX0201-kana, JISX0201-roman, JISX0208, JISX0212) | |
283 | |
284 (modify-category-entry (make-char 'katakana-jisx0201) ?k) | |
285 (modify-category-entry (make-char 'latin-jisx0201) ?r) | |
286 (modify-category-entry (make-char 'japanese-jisx0208) ?j) | |
287 (modify-category-entry (make-char 'japanese-jisx0212) ?j) | |
17753
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
288 (modify-category-entry (make-char 'katakana-jisx0201) ?\|) |
17052 | 289 (modify-category-entry (make-char 'japanese-jisx0208) ?\|) |
17753
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
290 (modify-category-entry (make-char 'japanese-jisx0212) ?\|) |
17052 | 291 |
292 ;; JISX0208 | |
293 (modify-syntax-entry (make-char 'japanese-jisx0208) "w") | |
294 (modify-syntax-entry (make-char 'japanese-jisx0208 33) "_") | |
295 (modify-syntax-entry (make-char 'japanese-jisx0208 34) "_") | |
296 (modify-syntax-entry (make-char 'japanese-jisx0208 40) "_") | |
297 (let ((chars '(?$B!<(B ?$B!+(B ?$B!,(B ?$B!3(B ?$B!4(B ?$B!5(B ?$B!6(B ?$B!7(B ?$B!8(B ?$B!9(B ?$B!:(B ?$B!;(B))) | |
298 (while chars | |
299 (modify-syntax-entry (car chars) "w") | |
300 (setq chars (cdr chars)))) | |
301 (modify-syntax-entry ?\$B!J(B "($B!K(B") | |
302 (modify-syntax-entry ?\$B!N(B "($B!O(B") | |
303 (modify-syntax-entry ?\$B!P(B "($B!Q(B") | |
304 (modify-syntax-entry ?\$B!V(B "($B!W(B") | |
305 (modify-syntax-entry ?\$B!X(B "($B!Y(B") | |
306 (modify-syntax-entry ?\$B!K(B ")$B!J(B") | |
307 (modify-syntax-entry ?\$B!O(B ")$B!N(B") | |
308 (modify-syntax-entry ?\$B!Q(B ")$B!P(B") | |
309 (modify-syntax-entry ?\$B!W(B ")$B!V(B") | |
310 (modify-syntax-entry ?\$B!Y(B ")$B!X(B") | |
311 | |
312 (modify-category-entry (make-char 'japanese-jisx0208 35) ?A) | |
313 (modify-category-entry (make-char 'japanese-jisx0208 36) ?H) | |
314 (modify-category-entry (make-char 'japanese-jisx0208 37) ?K) | |
315 (modify-category-entry (make-char 'japanese-jisx0208 38) ?G) | |
316 (modify-category-entry (make-char 'japanese-jisx0208 39) ?Y) | |
317 (let ((row 48)) | |
318 (while (< row 127) | |
319 (modify-category-entry (make-char 'japanese-jisx0208 row) ?C) | |
320 (setq row (1+ row)))) | |
17296
dc3f449803f6
Change a category of one Japanese character.
Kenichi Handa <handa@m17n.org>
parents:
17078
diff
changeset
|
321 (modify-category-entry ?$B!<(B ?K) |
dc3f449803f6
Change a category of one Japanese character.
Kenichi Handa <handa@m17n.org>
parents:
17078
diff
changeset
|
322 (let ((chars '(?$B!+(B ?$B!,(B))) |
17052 | 323 (while chars |
324 (modify-category-entry (car chars) ?K) | |
325 (modify-category-entry (car chars) ?H) | |
326 (setq chars (cdr chars)))) | |
327 (let ((chars '(?$B!3(B ?$B!4(B ?$B!5(B ?$B!6(B ?$B!7(B ?$B!8(B ?$B!9(B ?$B!:(B ?$B!;(B))) | |
328 (while chars | |
329 (modify-category-entry (car chars) ?C) | |
330 (setq chars (cdr chars)))) | |
331 | |
332 ;; JISX0212 | |
333 (modify-syntax-entry (make-char 'japanese-jisx0212) "w") | |
334 (modify-syntax-entry (make-char 'japanese-jisx0212 33) "_") | |
335 (modify-syntax-entry (make-char 'japanese-jisx0212 34) "_") | |
336 (modify-syntax-entry (make-char 'japanese-jisx0212 35) "_") | |
337 | |
338 (modify-category-entry (make-char 'japanese-jisx0212 ) ?C) | |
339 | |
340 ;; JISX0201-Kana | |
341 (modify-syntax-entry (make-char 'katakana-jisx0201) "w") | |
342 (let ((chars '(?(I!(B ?(I"(B ?(I#(B ?(I$(B ?(I%(B))) | |
343 (while chars | |
344 (modify-syntax-entry (car chars) ".") | |
345 (setq chars (cdr chars)))) | |
346 | |
347 ;; Korean character set (KSC5601) | |
348 | |
349 (modify-syntax-entry (make-char 'korean-ksc5601) "w") | |
350 (modify-syntax-entry (make-char 'korean-ksc5601 33) "_") | |
351 (modify-syntax-entry (make-char 'korean-ksc5601 34) "_") | |
352 (modify-syntax-entry (make-char 'korean-ksc5601 38) "_") | |
353 (modify-syntax-entry (make-char 'korean-ksc5601 39) "_") | |
354 (modify-syntax-entry (make-char 'korean-ksc5601 40) "_") | |
355 (modify-syntax-entry (make-char 'korean-ksc5601 41) "_") | |
356 | |
357 (modify-category-entry (make-char 'korean-ksc5601) ?h) | |
358 (modify-category-entry (make-char 'korean-ksc5601 35) ?A) | |
359 (modify-category-entry (make-char 'korean-ksc5601 37) ?G) | |
360 (modify-category-entry (make-char 'korean-ksc5601 42) ?H) | |
361 (modify-category-entry (make-char 'korean-ksc5601 43) ?K) | |
362 (modify-category-entry (make-char 'korean-ksc5601 44) ?Y) | |
363 | |
17078
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
364 ;; Lao character set |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
365 |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
366 (modify-category-entry (make-char 'lao) ?o) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
367 |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
368 (let ((deflist '(;; chars syntax category |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
369 ("(1!(B-(1N(B" "w" ?0) ; consonant |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
370 ("(1PRS]`(B-(1d(B" "w" ?1) ; vowel base |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
371 ("(1QT(B-(1W[m(B" "w" ?2) ; vowel upper |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
372 ("(1XY(B" "w" ?3) ; vowel lower |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
373 ("(1h(B-(1l(B" "w" ?4) ; tone mark |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
374 ("(1\(B" "w" ?9) ; semivowel lower |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
375 ("(1p(B-(1y(B" "w" ?0) ; digit and misc |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
376 ("(1Of(B" "_" ?0) ; symbol |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
377 )) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
378 elm chars len syntax category to ch i) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
379 (while deflist |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
380 (setq elm (car deflist)) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
381 (setq chars (car elm) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
382 len (length chars) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
383 syntax (nth 1 elm) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
384 category (nth 2 elm) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
385 i 0) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
386 (while (< i len) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
387 (if (= (aref chars i) ?-) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
388 (setq i (1+ i) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
389 to (sref chars i)) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
390 (setq ch (sref chars i) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
391 to ch)) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
392 (while (<= ch to) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
393 (modify-syntax-entry ch syntax) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
394 (modify-category-entry ch category) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
395 (setq ch (1+ ch))) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
396 (setq i (+ i (char-bytes to)))) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
397 (setq deflist (cdr deflist)))) |
874b471d6635
Remove prefix "coding-system-" from coding system symbol names.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
398 |
17052 | 399 ;; Thai character set (TIS620) |
400 | |
401 (modify-category-entry (make-char 'thai-tis620) ?t) | |
402 | |
403 (let ((deflist '(;; chars syntax category | |
404 (",T!(B-,TCEG(B-,TN(B" "w" ?0) ; consonant | |
405 (",TDFPRS`(B-,Te(B" "w" ?1) ; vowel base | |
406 (",TQT(B-,TWgn(B" "w" ?2) ; vowel upper | |
407 (",TX(B-,TZ(B" "w" ?3) ; vowel lower | |
408 (",Th(B-,Tm(B" "w" ?4) ; tone mark | |
409 (",TOfp(B-,Ty(B" "w" ?0) ; digit and misc | |
410 (",T_oz{(B" "_" ?0) ; symbol | |
411 )) | |
412 elm chars len syntax category to ch i) | |
413 (while deflist | |
414 (setq elm (car deflist)) | |
415 (setq chars (car elm) | |
416 len (length chars) | |
417 syntax (nth 1 elm) | |
418 category (nth 2 elm) | |
419 i 0) | |
420 (while (< i len) | |
421 (if (= (aref chars i) ?-) | |
422 (setq i (1+ i) | |
423 to (sref chars i)) | |
424 (setq ch (sref chars i) | |
425 to ch)) | |
426 (while (<= ch to) | |
427 (modify-syntax-entry ch syntax) | |
428 (modify-category-entry ch category) | |
429 (setq ch (1+ ch))) | |
430 (setq i (+ i (char-bytes to)))) | |
431 (setq deflist (cdr deflist)))) | |
432 | |
17753
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
433 ;; Tibetan character set |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
434 |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
435 (let ((row 33)) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
436 (while (< row 38) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
437 (modify-category-entry (make-char 'tibetan row) ?q) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
438 (setq row (1+ row)))) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
439 |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
440 (modify-category-entry (make-char 'tibetan-1-column 33) ?q) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
441 |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
442 (let ((deflist '(;; chars syntax category |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
443 ("$(7"!(B-$(7"J(B" "w" ?0) ; consonant |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
444 ("$(7#!(B-$(7#J#P#Q(B" "w" ?0) ; |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
445 ("$(7$!(B-$(7$e(B" "w" ?0) ; |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
446 ("$(7%!(B-$(7%u(B" "w" ?0) ; |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
447 ("$(7"S"["\"]"^"a(B" "w" ?2) ; upper vowel |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
448 ("$(7"_"c"d"g"h"i"j"k"l(B" "w" ?2) ; upper modifier |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
449 ("$(7!I"Q"U"e!e!g(B" "w" ?3) ; lowel vowel/modifier |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
450 ("$(7!P(B-$(7!Y!Z(B-$(7!c(B" "w" ?6) ; digit |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
451 ("$(7!;!=(B-$(7!B!D"`(B" "." ?|) ; line-break char |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
452 ("$(8!;!=!?!@!A!D"`(B" "." ?|) ; |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
453 ("$(7!8!;!=(B-$(7!B!D"`!m!d(B" "." ?>) ; prohibition |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
454 ("$(8!;!=!?!@!A!D"`(B" "." ?>) ; |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
455 ("$(7!0(B-$(7!:!l#R#S"f(B" "." ?<) ; prohibition |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
456 ("$(7!C!E(B-$(7!H!J(B-$(7!O!f!h(B-$(7!k!n!o(B" "." ?q) ; others |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
457 )) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
458 elm chars len syntax category to ch i) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
459 (while deflist |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
460 (setq elm (car deflist)) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
461 (setq chars (car elm) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
462 len (length chars) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
463 syntax (nth 1 elm) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
464 category (nth 2 elm) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
465 i 0) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
466 (while (< i len) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
467 (if (= (aref chars i) ?-) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
468 (setq i (1+ i) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
469 to (sref chars i)) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
470 (setq ch (sref chars i) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
471 to ch)) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
472 (while (<= ch to) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
473 (modify-syntax-entry ch syntax) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
474 (modify-category-entry ch category) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
475 (setq ch (1+ ch))) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
476 (setq i (+ i (char-bytes to)))) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
477 (setq deflist (cdr deflist)))) |
de6be7f3b904
Set syntax and category for Devanagari, Thai, and
Kenichi Handa <handa@m17n.org>
parents:
17296
diff
changeset
|
478 |
17052 | 479 ;; Vietnamese character set |
480 | |
481 (let ((lower (make-char 'vietnamese-viscii-lower)) | |
482 (upper (make-char 'vietnamese-viscii-upper))) | |
483 (modify-syntax-entry lower "w") | |
484 (modify-syntax-entry upper "w") | |
485 (modify-category-entry lower ?v) | |
486 (modify-category-entry upper ?v) | |
487 (modify-category-entry lower ?l) ; To make a word with | |
488 (modify-category-entry upper ?l) ; latin characters. | |
489 ) | |
490 | |
491 | |
492 ;;; Setting word boundary. | |
493 | |
494 (setq word-combining-categories | |
495 '((?l . ?l))) | |
496 | |
497 (setq word-separating-categories ; (2-byte character sets) | |
498 '((?A . ?K) ; Alpha numeric - Katakana | |
499 (?A . ?C) ; Alpha numeric - Chinese | |
500 (?H . ?A) ; Hiragana - Alpha numeric | |
501 (?H . ?K) ; Hiragana - Katakana | |
502 (?H . ?C) ; Hiragana - Chinese | |
503 (?K . ?A) ; Katakana - Alpha numeric | |
504 (?K . ?C) ; Katakana - Chinese | |
505 (?C . ?A) ; Chinese - Alpha numeric | |
506 (?C . ?K) ; Chinese - Katakana | |
507 )) |