diff options
| author | Kenichi Handa | 2005-03-29 07:47:09 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-03-29 07:47:09 +0000 |
| commit | 675ae7bc050a15b30418aed04ec0b0b6c54842ab (patch) | |
| tree | 62cd98a612f73423ee588798cbe8e644528ced99 | |
| parent | d59ea3ae6d3986d8f9b313b2f1258535ad0674c1 (diff) | |
| download | emacs-675ae7bc050a15b30418aed04ec0b0b6c54842ab.tar.gz emacs-675ae7bc050a15b30418aed04ec0b0b6c54842ab.zip | |
(thai-word-table): Declare it by defvar,
use dolist to initialize it.
(thai-kill-word, thai-backward-kill-word, thai-transpose-words)
(thai-fill-find-break-point): New functions.
| -rw-r--r-- | lisp/language/thai-word.el | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/lisp/language/thai-word.el b/lisp/language/thai-word.el index 82f6fcdea6a..9c3ba81859e 100644 --- a/lisp/language/thai-word.el +++ b/lisp/language/thai-word.el | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | ;;; thai-word.el -- find Thai word boundaries | 1 | ;;; thai-word.el -- find Thai word boundaries |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000, 2001, 2002, 2003, 2004 | 3 | ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 |
| 4 | ;; Electrotechnical Laboratory, JAPAN. | 4 | ;; National Institute of Advanced Industrial Science and Technology (AIST) |
| 5 | ;; Registration Number H14PRO021 | ||
| 5 | 6 | ||
| 6 | ;; Author: Kenichi HANDA <handa@etl.go.jp> | 7 | ;; Author: Kenichi HANDA <handa@etl.go.jp> |
| 7 | 8 | ||
| @@ -72,13 +73,10 @@ | |||
| 72 | ;; which means that you can easily index the list character by | 73 | ;; which means that you can easily index the list character by |
| 73 | ;; character. | 74 | ;; character. |
| 74 | 75 | ||
| 75 | (defconst thai-word-table nil) | 76 | (defvar thai-word-table |
| 76 | 77 | (let ((table (list 'thai-words))) | |
| 77 | 78 | (dolist (elt | |
| 78 | ;; Set up `thai-word-table'. | 79 | ;;; The following is indented as this to minimize this file size. |
| 79 | |||
| 80 | (let | ||
| 81 | ((l | ||
| 82 | '("¡¡" | 80 | '("¡¡" |
| 83 | "¡¡Å" | 81 | "¡¡Å" |
| 84 | "¡¡Ø¸Àѳ±ì" | 82 | "¡¡Ø¸Àѳ±ì" |
| @@ -10732,11 +10730,10 @@ | |||
| 10732 | "äÎâ¡ÃÁÔàµÍÃì" | 10730 | "äÎâ¡ÃÁÔàµÍÃì" |
| 10733 | "äÎâ´Ã¤ÒÃìºÍ¹" | 10731 | "äÎâ´Ã¤ÒÃìºÍ¹" |
| 10734 | "äÎâÅ" | 10732 | "äÎâÅ" |
| 10735 | ))) | 10733 | )) |
| 10736 | (setq thai-word-table (list 'thai-words)) | 10734 | (set-nested-alist elt 1 table)) |
| 10737 | (while l | 10735 | table) |
| 10738 | (set-nested-alist (car l) 1 thai-word-table) | 10736 | "Nested alist of Thai words.") |
| 10739 | (setq l (cdr l)))) | ||
| 10740 | 10737 | ||
| 10741 | 10738 | ||
| 10742 | (defun thai-update-word-table (file &optional append) | 10739 | (defun thai-update-word-table (file &optional append) |
| @@ -11042,6 +11039,33 @@ If COUNT is negative, move point forward (- COUNT) words." | |||
| 11042 | (thai-forward-word (- count))) | 11039 | (thai-forward-word (- count))) |
| 11043 | 11040 | ||
| 11044 | 11041 | ||
| 11042 | (defun thai-kill-word (arg) | ||
| 11043 | "Like kill-word but pay attention to Thai word boundaries. | ||
| 11044 | With argument, do this that many times." | ||
| 11045 | (interactive "p") | ||
| 11046 | (kill-region (point) (progn (thai-forward-word arg) (point)))) | ||
| 11047 | |||
| 11048 | |||
| 11049 | (defun thai-backward-kill-word (arg) | ||
| 11050 | "Like backward-kill-word but pay attention to Thai word boundaries." | ||
| 11051 | (interactive "p") | ||
| 11052 | (thai-kill-word (- arg))) | ||
| 11053 | |||
| 11054 | |||
| 11055 | (defun thai-transpose-words (arg) | ||
| 11056 | "Like transpose-words but pay attention to Thai word boundaries." | ||
| 11057 | (interactive "*p") | ||
| 11058 | (transpose-subr 'thai-forward-word arg)) | ||
| 11059 | |||
| 11060 | (defun thai-fill-find-break-point (linebeg) | ||
| 11061 | "Go to a line breaking position near point considering Thai word boundaries." | ||
| 11062 | (let ((pos (point))) | ||
| 11063 | (thai-forward-word -1) | ||
| 11064 | (when (<= (point) linebeg) | ||
| 11065 | (goto-char pos) | ||
| 11066 | (thai-forward-word 1)) | ||
| 11067 | (kinsoku linebeg))) | ||
| 11068 | |||
| 11045 | (provide 'thai-word) | 11069 | (provide 'thai-word) |
| 11046 | 11070 | ||
| 11047 | 11071 | ||