# HG changeset patch # User Kenichi Handa # Date 1036650746 0 # Node ID b1774ad77cc754871f1bef1150a321ef9e00ee3f # Parent 85b9175715b810e17ad47a29caec7196ea38ef48 (thai-post-read-conversion): Delete this function. (thai-composition-function): Change arguments to conform to composition-function-table. diff -r 85b9175715b8 -r b1774ad77cc7 lisp/language/thai-util.el --- a/lisp/language/thai-util.el Thu Nov 07 06:32:02 2002 +0000 +++ b/lisp/language/thai-util.el Thu Nov 07 06:32:26 2002 +0000 @@ -185,24 +185,20 @@ (thai-compose-region (point-min) (point-max))) ;;;###autoload -(defun thai-post-read-conversion (len) - (thai-compose-region (point) (+ (point) len)) - len) - -;;;###autoload -(defun thai-composition-function (from to pattern &optional string) - "Compose Thai text in the region FROM and TO. -The text matches the regular expression PATTERN. -Optional 4th argument STRING, if non-nil, is a string containing text -to compose. - -The return value is number of composed characters." - (if (< (1+ from) to) - (prog1 (- to from) - (if string - (compose-string string from to) - (compose-region from to)) - (- to from)))) +(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]?")) + (if string + (if (and (>= pos 0) + (eq (string-match pattern string pos) pos)) + (prog1 (match-end 0) + (compose-string string pos (match-end 0)))) + (if (>= pos (point-min)) + (progn + (goto-char pos) + (if (looking-at pattern) + (prog1 (match-end 0) + (compose-region pos (match-end 0))))))))) ;; (provide 'thai-util)