changeset 90130:5c6cb7e043ea

Sync with the main trunk.
author Kenichi Handa <handa@m17n.org>
date Mon, 28 Mar 2005 07:31:49 +0000
parents 9d3c061434e6
children 503a3c779486
files lisp/language/thai-util.el
diffstat 1 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/language/thai-util.el	Thu Mar 24 20:57:23 2005 +0000
+++ b/lisp/language/thai-util.el	Mon Mar 28 07:31:49 2005 +0000
@@ -172,20 +172,17 @@
 	     (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 @@
 ;;;###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)