summaryrefslogtreecommitdiff
path: root/lisp/language/thai-util.el
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2005-03-28 07:31:49 +0000
committerKenichi Handa <handa@m17n.org>2005-03-28 07:31:49 +0000
commite8d0ae6b0b835d73ae5b4318381dbfe90d263efb (patch)
tree557d04b97dd84ba737a472b39abf55ae86584659 /lisp/language/thai-util.el
parent4970773706e1c006c071d1e76044571e7f5c8875 (diff)
downloademacs-e8d0ae6b0b835d73ae5b4318381dbfe90d263efb.tar.gz
Sync with the main trunk.
Diffstat (limited to 'lisp/language/thai-util.el')
-rw-r--r--lisp/language/thai-util.el23
1 files changed, 10 insertions, 13 deletions
diff --git a/lisp/language/thai-util.el b/lisp/language/thai-util.el
index b39fadf9567..0957748799d 100644
--- a/lisp/language/thai-util.el
+++ b/lisp/language/thai-util.el
@@ -172,20 +172,17 @@ if necessary."
(global-set-key (vector char) 'thai-self-insert-command))
((memq ptype '(vowel-upper vowel-lower))
(modify-category-entry char ?v thai-category-table)
- (if (or (= char ?,TT(B) (= char ?$,1C4(B))
+ (if (= char ?,TT(B)
;; Give category `I' to "SARA I".
- (modify-category-entry char ?I thai-category-table))
- (global-set-key (vector char) 'thai-self-insert-command))
+ (modify-category-entry char ?I thai-category-table)))
((eq ptype 'tone)
(modify-category-entry char ?t thai-category-table)
- (modify-category-entry char ?u thai-category-table)
- (global-set-key (vector char) 'thai-self-insert-command))
+ (modify-category-entry char ?u thai-category-table))
((eq ptype 'sign-upper)
(modify-category-entry char ?u thai-category-table)
- (if (or (= char ?,Tl(B) (= char ?$,1CL(B))
+ (if (= char ?,Tl(B)
;; Give category `U' to "THANTHAKHAT".
- (modify-category-entry char ?U thai-category-table))
- (global-set-key (vector char) 'thai-self-insert-command)))
+ (modify-category-entry char ?U thai-category-table))))
(put-char-code-property char 'name (nth 2 elm)))))
(defun thai-compose-syllable (beg end &optional category-set string)
@@ -243,18 +240,18 @@ positions (integers or markers) specifying the region."
;;;###autoload
(defun thai-composition-function (pos &optional string)
(setq pos (1- pos))
- (let ((pattern "[,T!(B-,TCEG(B-,TN!(B-,TCEG(B-,TN(B][,TQT(B-,TWgnX(B-,TZQT(B-,TWgnX(B-,TZ(B]?[,Th(B-,Tmh(B-,Tm(B]?"))
+ (with-category-table thai-category-table
(if string
(if (and (>= pos 0)
- (eq (string-match pattern string pos) pos))
+ (eq (string-match thai-composition-pattern string pos) pos))
(prog1 (match-end 0)
- (compose-string string pos (match-end 0))))
+ (thai-compose-syllable pos (match-end 0) nil string)))
(if (>= pos (point-min))
(progn
(goto-char pos)
- (if (looking-at pattern)
+ (if (looking-at thai-composition-pattern)
(prog1 (match-end 0)
- (compose-region pos (match-end 0)))))))))
+ (thai-compose-syllable pos (match-end 0)))))))))
;;
(provide 'thai-util)