aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/language/thai-util.el
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2002-11-07 06:32:26 +0000
committerKenichi Handa <[email protected]>2002-11-07 06:32:26 +0000
commited01146036acc018eb62e5e41e6ab34b44853a7e (patch)
tree676616012f759cc03a2c8ca1477793fdac6515e2 /lisp/language/thai-util.el
parent1662e139884f13ba1f5218749b2c493fc0117295 (diff)
(thai-post-read-conversion): Delete this
function. (thai-composition-function): Change arguments to conform to composition-function-table.
Diffstat (limited to 'lisp/language/thai-util.el')
-rw-r--r--lisp/language/thai-util.el32
1 files changed, 14 insertions, 18 deletions
diff --git a/lisp/language/thai-util.el b/lisp/language/thai-util.el
index eaae6601c7..734ea4de5f 100644
--- a/lisp/language/thai-util.el
+++ b/lisp/language/thai-util.el
@@ -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 "[,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)