/[emacs]/emacs/lisp/language/thai-util.el
ViewVC logotype

Diff of /emacs/lisp/language/thai-util.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by handa, Fri Mar 18 06:51:41 2005 UTC revision 1.29 by handa, Tue Mar 29 07:50:59 2005 UTC
# Line 1  Line 1 
1  ;;; thai-util.el --- utilities for Thai -*- coding: iso-2022-7bit; -*-  ;;; thai-util.el --- utilities for Thai -*- coding: iso-2022-7bit; -*-
2    
3  ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.  ;; Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2005
 ;; Licensed to the Free Software Foundation.  
 ;; Copyright (C) 2005  
4  ;;   National Institute of Advanced Industrial Science and Technology (AIST)  ;;   National Institute of Advanced Industrial Science and Technology (AIST)
5  ;;   Registration Number H14PRO021  ;;   Registration Number H14PRO021
6    
# Line 382  The return value is number of composed c Line 380  The return value is number of composed c
380          (t          (t
381           (add-hook 'after-change-functions 'thai-auto-composition))))           (add-hook 'after-change-functions 'thai-auto-composition))))
382    
383    ;; Thai-word-mode requires functions in the feature `thai-word'.
384    (require 'thai-word)
385    
386    (defvar thai-word-mode-map
387      (let ((map (make-sparse-keymap)))
388        (define-key map [remap forward-word] 'thai-forward-word)
389        (define-key map [remap backward-word] 'thai-backward-word)
390        (define-key map [remap kill-word] 'thai-kill-word)
391        (define-key map [remap backward-kill-word] 'thai-backward-kill-word)
392        (define-key map [remap transpose-words] 'thai-transpose-words)
393        map)
394      "Keymap for `thai-word-mode'.")
395    
396    (define-minor-mode thai-word-mode
397      "Minor mode to make word-oriented commands aware of Thai words.
398    The commands affected are \\[forward-word], \\[backward-word], \\[kill-word], \\[backward-kill-word], \\[transpose-words], and \\[fill-paragraph]."
399      :global t
400      (cond (thai-word-mode
401             ;; This enables linebreak between Thai characters.
402             (modify-category-entry (make-char 'thai-tis620) ?|)
403             ;; This enables linebreak at a Thai word boundary.
404             (put-charset-property 'thai-tis620 'fill-find-break-point-function
405                                   'thai-fill-find-break-point))
406            (t
407             (modify-category-entry (make-char 'thai-tis620) ?| nil t)
408             (put-charset-property 'thai-tis620 'fill-find-break-point-function
409                                   nil))))
410    
411    ;; Function to call on entering the Thai language environment.
412    (defun setup-thai-language-environment-internal ()
413      (thai-word-mode 1))
414    
415    ;; Function to call on exiting the Thai language environment.
416    (defun exit-thai-language-environment-internal ()
417      (thai-word-mode -1))
418    
419  ;;  ;;
420  (provide 'thai-util)  (provide 'thai-util)
421    

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26