changeset 92177:cda257a419a0

(lao-composition-function): Adjusted for the new calling way.
author Kenichi Handa <handa@m17n.org>
date Mon, 25 Feb 2008 01:35:50 +0000
parents e2a1aae77a33
children 008ecb0c705a
files lisp/language/lao-util.el
diffstat 1 files changed, 10 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/language/lao-util.el	Mon Feb 25 01:34:52 2008 +0000
+++ b/lisp/language/lao-util.el	Mon Feb 25 01:35:50 2008 +0000
@@ -493,20 +493,19 @@
       lao-str)))
 
 ;;;###autoload
-(defun lao-composition-function (pos &optional string)
-  (setq pos (1- pos))
-  (with-category-table lao-category-table
-    (if string
-	(if (and (>= pos 0)
-		 (eq (string-match lao-composition-pattern string pos) pos))
-	    (prog1 (match-end 0)
-	      (compose-string string pos (match-end 0))))
-      (if (>= pos (point-min))
+(defun lao-composition-function (from to font-object string)
+  (or (and font-object
+	   (font-shape-text from to font-object string))
+      (with-category-table lao-category-table
+	(if string
+	    (if (eq (string-match lao-composition-pattern string from) to)
+		(prog1 (match-end 0)
+		  (compose-string string from (match-end 0))))
 	  (save-excursion
-	    (goto-char pos)
+	    (goto-char from)
 	    (if (looking-at lao-composition-pattern)
 		(prog1 (match-end 0)
-		  (compose-region pos (match-end 0)))))))))
+		  (compose-region from (match-end 0)))))))))
 
 ;;;###autoload
 (defun lao-compose-region (from to)