diff options
author | Kenichi Handa <handa@m17n.org> | 2005-03-29 07:50:59 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2005-03-29 07:50:59 +0000 |
commit | 1085b5512ac943c0f835e4b95eb8b149321f5924 (patch) | |
tree | d70bc5a20314ca02c5cb4bfad96ed15126fcff55 /lisp/language | |
parent | 675ae7bc050a15b30418aed04ec0b0b6c54842ab (diff) | |
download | emacs-1085b5512ac943c0f835e4b95eb8b149321f5924.tar.gz emacs-1085b5512ac943c0f835e4b95eb8b149321f5924.tar.bz2 emacs-1085b5512ac943c0f835e4b95eb8b149321f5924.zip |
Require thai-word.
(thai-word-mode-map): New variable.
(thai-word-mode): New minor mode.
(setup-thai-language-environment-internal): New function.
(exit-thai-language-environment-internal): New function.
Diffstat (limited to 'lisp/language')
-rw-r--r-- | lisp/language/thai-util.el | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/lisp/language/thai-util.el b/lisp/language/thai-util.el index 09f84d6fad6..e130c187c6d 100644 --- a/lisp/language/thai-util.el +++ b/lisp/language/thai-util.el @@ -1,8 +1,6 @@ ;;; thai-util.el --- utilities for Thai -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. -;; Licensed to the Free Software Foundation. -;; Copyright (C) 2005 +;; Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2005 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 @@ -382,6 +380,42 @@ The return value is number of composed characters." (t (add-hook 'after-change-functions 'thai-auto-composition)))) +;; Thai-word-mode requires functions in the feature `thai-word'. +(require 'thai-word) + +(defvar thai-word-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [remap forward-word] 'thai-forward-word) + (define-key map [remap backward-word] 'thai-backward-word) + (define-key map [remap kill-word] 'thai-kill-word) + (define-key map [remap backward-kill-word] 'thai-backward-kill-word) + (define-key map [remap transpose-words] 'thai-transpose-words) + map) + "Keymap for `thai-word-mode'.") + +(define-minor-mode thai-word-mode + "Minor mode to make word-oriented commands aware of Thai words. +The commands affected are \\[forward-word], \\[backward-word], \\[kill-word], \\[backward-kill-word], \\[transpose-words], and \\[fill-paragraph]." + :global t + (cond (thai-word-mode + ;; This enables linebreak between Thai characters. + (modify-category-entry (make-char 'thai-tis620) ?|) + ;; This enables linebreak at a Thai word boundary. + (put-charset-property 'thai-tis620 'fill-find-break-point-function + 'thai-fill-find-break-point)) + (t + (modify-category-entry (make-char 'thai-tis620) ?| nil t) + (put-charset-property 'thai-tis620 'fill-find-break-point-function + nil)))) + +;; Function to call on entering the Thai language environment. +(defun setup-thai-language-environment-internal () + (thai-word-mode 1)) + +;; Function to call on exiting the Thai language environment. +(defun exit-thai-language-environment-internal () + (thai-word-mode -1)) + ;; (provide 'thai-util) |