# HG changeset patch # User Kenichi Handa # Date 915509230 0 # Node ID 9ae5e1af351813ee15c330c893b9c2ccbeffad7f # Parent d90d3da56713fdf0734fe6093abbe78c51b44a78 (thai-compose-string): New function. diff -r d90d3da56713 -r 9ae5e1af3518 lisp/language/thai-util.el --- a/lisp/language/thai-util.el Tue Jan 05 02:39:31 1999 +0000 +++ b/lisp/language/thai-util.el Tue Jan 05 04:07:10 1999 +0000 @@ -164,6 +164,25 @@ (set-category-table current-ctbl))))) ;;;###autoload +(defun thai-compose-string (string) + "Compose Thai characters in STRING and return the resulting string." + (let ((current-ctbl (category-table))) + (set-category-table thai-category-table) + (unwind-protect + (let ((idx 0) + (new "")) + (while (string-match "\\c+\\c-+" string idx) + (if (< idx (match-beginning 0)) + (setq new + (concat new (substring string idx (match-beginning 0))))) + (setq new (concat new (compose-string (match-string 0 string)))) + (setq idx (match-end 0))) + (if (< idx (length string)) + (setq new (concat new (substring string idx)))) + new) + (set-category-table current-ctbl)))) + +;;;###autoload (defun thai-compose-buffer () "Compose Thai characters in the current buffer." (interactive)