Mercurial > emacs
comparison lisp/language/thai-util.el @ 90138:78f873064412
Fix previous change.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Sat, 09 Apr 2005 01:42:04 +0000 |
parents | 4da4a09e8b1b |
children | 02f1dbc4a199 |
comparison
equal
deleted
inserted
replaced
90137:e465b832ab21 | 90138:78f873064412 |
---|---|
51 | 51 |
52 | 52 |
53 (defvar thai-composition-pattern | 53 (defvar thai-composition-pattern |
54 "\\cc\\(\\cu\\|\\cI\\cU\\|\\cv\\ct?\\)\\|\\cv\\ct\\|\\cI\\cU" | 54 "\\cc\\(\\cu\\|\\cI\\cU\\|\\cv\\ct?\\)\\|\\cv\\ct\\|\\cI\\cU" |
55 "Regular expression matching a Thai composite sequence.") | 55 "Regular expression matching a Thai composite sequence.") |
56 | |
57 (defun thai-self-insert-command (&optional n) | |
58 "Insert the Thai character you type. | |
59 The character will be composed with the surrounding Thai character | |
60 if necessary." | |
61 (interactive "*p") | |
62 (let ((pos (point)) | |
63 category-set ch) | |
64 (self-insert-command n) | |
65 (or thai-auto-composition-mode | |
66 (thai-auto-composition (1- (point)) (point) 0)))) | |
67 | 56 |
68 (let ((l '((?,T!(B consonant "LETTER KO KAI") ; 0xA1 | 57 (let ((l '((?,T!(B consonant "LETTER KO KAI") ; 0xA1 |
69 (?,T"(B consonant "LETTER KHO KHAI") ; 0xA2 | 58 (?,T"(B consonant "LETTER KHO KHAI") ; 0xA2 |
70 (?,T#(B consonant "LETTER KHO KHUAT") ; 0xA3 | 59 (?,T#(B consonant "LETTER KHO KHUAT") ; 0xA3 |
71 (?,T$(B consonant "LETTER KHO KHWAI") ; 0xA4 | 60 (?,T$(B consonant "LETTER KHO KHWAI") ; 0xA4 |
165 (setq elm (car l) l (cdr l)) | 154 (setq elm (car l) l (cdr l)) |
166 (let ((char (car elm)) | 155 (let ((char (car elm)) |
167 (ptype (nth 1 elm))) | 156 (ptype (nth 1 elm))) |
168 (put-char-code-property char 'phonetic-type ptype) | 157 (put-char-code-property char 'phonetic-type ptype) |
169 (cond ((eq ptype 'consonant) | 158 (cond ((eq ptype 'consonant) |
170 (modify-category-entry char ?c thai-category-table) | 159 (modify-category-entry char ?c thai-category-table)) |
171 (global-set-key (vector char) 'thai-self-insert-command)) | |
172 ((memq ptype '(vowel-upper vowel-lower)) | 160 ((memq ptype '(vowel-upper vowel-lower)) |
173 (modify-category-entry char ?v thai-category-table) | 161 (modify-category-entry char ?v thai-category-table) |
174 (if (= char ?,TT(B) | 162 (if (= char ?,TT(B) |
175 ;; Give category `I' to "SARA I". | 163 ;; Give category `I' to "SARA I". |
176 (modify-category-entry char ?I thai-category-table))) | 164 (modify-category-entry char ?I thai-category-table))) |