• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/language/

Lines Matching +defs:thai +defs:composition +defs:function

0 ;;; thai-util.el --- utilities for Thai -*- coding: iso-2022-7bit; -*-
10 ;; Keywords: mule, multilingual, thai
33 (defvar thai-auto-composition-mode)
37 (defconst thai-category-table (make-category-table))
38 (define-category ?c "Thai consonant" thai-category-table)
39 (define-category ?v "Thai upper/lower vowel" thai-category-table)
40 (define-category ?t "Thai tone mark" thai-category-table)
41 (define-category ?u "Thai tone mark and upper sign" thai-category-table)
42 (define-category ?I "THAI CHARACTER SARA I" thai-category-table)
43 (define-category ?U "THAI CHARACTER THANTHAKHAT" thai-category-table)
57 (defvar thai-composition-pattern
61 (defun thai-self-insert-command (&optional n)
69 (or thai-auto-composition-mode
70 (thai-auto-composition (1- (point)) (point) 0))))
263 (modify-category-entry char ?c thai-category-table)
264 (global-set-key (vector char) 'thai-self-insert-command))
266 (modify-category-entry char ?v thai-category-table)
269 (modify-category-entry char ?I thai-category-table))
270 (global-set-key (vector char) 'thai-self-insert-command))
272 (modify-category-entry char ?t thai-category-table)
273 (modify-category-entry char ?u thai-category-table)
274 (global-set-key (vector char) 'thai-self-insert-command))
276 (modify-category-entry char ?u thai-category-table)
279 (modify-category-entry char ?U thai-category-table))
280 (global-set-key (vector char) 'thai-self-insert-command)))
283 (defun thai-compose-syllable (beg end &optional category-set string)
288 ;; Starting with a consonant. We do relative composition.
301 (defun thai-compose-region (beg end)
310 (with-category-table thai-category-table
311 (while (re-search-forward thai-composition-pattern nil t)
315 (thai-compose-syllable beg end
320 (defun thai-compose-string (string)
322 (with-category-table thai-category-table
324 (while (setq idx (string-match thai-composition-pattern string idx))
325 (thai-compose-syllable idx (match-end 0) nil string)
330 (defun thai-compose-buffer ()
333 (thai-compose-region (point-min) (point-max)))
336 (defun thai-post-read-conversion (len)
337 (thai-compose-region (point) (+ (point) len))
341 (defun thai-composition-function (from to pattern &optional string)
348 (when (and (not thai-auto-composition-mode)
350 (with-category-table thai-category-table
352 (if (eq (string-match thai-composition-pattern string from) from)
353 (thai-compose-syllable from (match-end 0) nil string))
356 (and (looking-at thai-composition-pattern)
358 (thai-compose-syllable from to))))))
360 (defun thai-auto-composition (beg end len)
361 (with-category-table thai-category-table
375 (thai-compose-region beg end)))))
377 (put 'thai-auto-composition-mode 'permanent-local t)
380 (define-minor-mode thai-auto-composition-mode
381 "Minor mode for automatically correct Thai character composition."
383 (cond ((null thai-auto-composition-mode)
384 (remove-hook 'after-change-functions 'thai-auto-composition))
386 (add-hook 'after-change-functions 'thai-auto-composition))))
388 ;; Thai-word-mode requires functions in the feature `thai-word'.
389 (require 'thai-word)
391 (defvar thai-word-mode-map
393 (define-key map [remap forward-word] 'thai-forward-word)
394 (define-key map [remap backward-word] 'thai-backward-word)
395 (define-key map [remap kill-word] 'thai-kill-word)
396 (define-key map [remap backward-kill-word] 'thai-backward-kill-word)
397 (define-key map [remap transpose-words] 'thai-transpose-words)
399 "Keymap for `thai-word-mode'.")
401 (define-minor-mode thai-word-mode
405 (cond (thai-word-mode
407 (modify-category-entry (make-char 'thai-tis620) ?|)
409 (put-charset-property 'thai-tis620 'fill-find-break-point-function
410 'thai-fill-find-break-point))
412 (modify-category-entry (make-char 'thai-tis620) ?| nil t)
413 (put-charset-property 'thai-tis620 'fill-find-break-point-function
417 (defun setup-thai-language-environment-internal ()
418 (thai-word-mode 1))
421 (defun exit-thai-language-environment-internal ()
422 (thai-word-mode -1))
425 (provide 'thai-util)
428 ;;; thai-util.el ends here