diff options
| author | Kenichi Handa | 1999-01-05 04:07:10 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-01-05 04:07:10 +0000 |
| commit | 0a57cf5133908a31dcdd615aad5e6c24d485ee43 (patch) | |
| tree | 906f072c79d62a946472a44bb23f24bded866ae1 | |
| parent | 971c2d04d2c337195c15002b48deafdb084d89fe (diff) | |
| download | emacs-0a57cf5133908a31dcdd615aad5e6c24d485ee43.tar.gz emacs-0a57cf5133908a31dcdd615aad5e6c24d485ee43.zip | |
(thai-compose-string): New function.
| -rw-r--r-- | lisp/language/thai-util.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/language/thai-util.el b/lisp/language/thai-util.el index cce6f12696b..2c891d0d992 100644 --- a/lisp/language/thai-util.el +++ b/lisp/language/thai-util.el | |||
| @@ -164,6 +164,25 @@ positions (integers or markers) specifying the region." | |||
| 164 | (set-category-table current-ctbl))))) | 164 | (set-category-table current-ctbl))))) |
| 165 | 165 | ||
| 166 | ;;;###autoload | 166 | ;;;###autoload |
| 167 | (defun thai-compose-string (string) | ||
| 168 | "Compose Thai characters in STRING and return the resulting string." | ||
| 169 | (let ((current-ctbl (category-table))) | ||
| 170 | (set-category-table thai-category-table) | ||
| 171 | (unwind-protect | ||
| 172 | (let ((idx 0) | ||
| 173 | (new "")) | ||
| 174 | (while (string-match "\\c+\\c-+" string idx) | ||
| 175 | (if (< idx (match-beginning 0)) | ||
| 176 | (setq new | ||
| 177 | (concat new (substring string idx (match-beginning 0))))) | ||
| 178 | (setq new (concat new (compose-string (match-string 0 string)))) | ||
| 179 | (setq idx (match-end 0))) | ||
| 180 | (if (< idx (length string)) | ||
| 181 | (setq new (concat new (substring string idx)))) | ||
| 182 | new) | ||
| 183 | (set-category-table current-ctbl)))) | ||
| 184 | |||
| 185 | ;;;###autoload | ||
| 167 | (defun thai-compose-buffer () | 186 | (defun thai-compose-buffer () |
| 168 | "Compose Thai characters in the current buffer." | 187 | "Compose Thai characters in the current buffer." |
| 169 | (interactive) | 188 | (interactive) |