]> git.eshelyaron.com Git - emacs.git/commitdiff
(thai-post-read-conversion): Delete this
authorKenichi Handa <handa@m17n.org>
Thu, 7 Nov 2002 06:32:26 +0000 (06:32 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 7 Nov 2002 06:32:26 +0000 (06:32 +0000)
function.
(thai-composition-function): Change arguments to conform to
composition-function-table.

lisp/language/thai-util.el

index eaae6601c7d141a12b5573ff63afcfb661513a72..734ea4de5f3cfe88ef2517cbb188bfefe2927e16 100644 (file)
@@ -185,24 +185,20 @@ positions (integers or markers) specifying the region."
   (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 "[\e,T!\e(B-\e,TCEG\e(B-\e,TN!\e(B-\e,TCEG\e(B-\e,TN\e(B][\e,TQT\e(B-\e,TWgnX\e(B-\e,TZQT\e(B-\e,TWgnX\e(B-\e,TZ\e(B]?[\e,Th\e(B-\e,Tmh\e(B-\e,Tm\e(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)