1 |
;;; thai-word.el -- find Thai word boundaries |
;;; thai-word.el -- find Thai word boundaries |
2 |
|
|
3 |
;; Copyright (C) 2000, 2001, 2002, 2003, 2004 |
;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 |
4 |
;; Electrotechnical Laboratory, JAPAN. |
;; National Institute of Advanced Industrial Science and Technology (AIST) |
5 |
|
;; Registration Number H14PRO021 |
6 |
|
|
7 |
;; Author: Kenichi HANDA <handa@etl.go.jp> |
;; Author: Kenichi HANDA <handa@etl.go.jp> |
8 |
|
|
73 |
;; which means that you can easily index the list character by |
;; which means that you can easily index the list character by |
74 |
;; character. |
;; character. |
75 |
|
|
76 |
(defconst thai-word-table nil) |
(defvar thai-word-table |
77 |
|
(let ((table (list 'thai-words))) |
78 |
|
(dolist (elt |
79 |
;; Set up `thai-word-table'. |
;;; The following is indented as this to minimize this file size. |
|
|
|
|
(let |
|
|
((l |
|
80 |
'("¡¡" |
'("¡¡" |
81 |
"¡¡Å" |
"¡¡Å" |
82 |
"¡¡Ø¸Àѳ±ì" |
"¡¡Ø¸Àѳ±ì" |
10730 |
"äÎâ¡ÃÁÔàµÍÃì" |
"äÎâ¡ÃÁÔàµÍÃì" |
10731 |
"äÎâ´Ã¤ÒÃìºÍ¹" |
"äÎâ´Ã¤ÒÃìºÍ¹" |
10732 |
"äÎâÅ" |
"äÎâÅ" |
10733 |
))) |
)) |
10734 |
(setq thai-word-table (list 'thai-words)) |
(set-nested-alist elt 1 table)) |
10735 |
(while l |
table) |
10736 |
(set-nested-alist (car l) 1 thai-word-table) |
"Nested alist of Thai words.") |
|
(setq l (cdr l)))) |
|
10737 |
|
|
10738 |
|
|
10739 |
(defun thai-update-word-table (file &optional append) |
(defun thai-update-word-table (file &optional append) |
11039 |
(thai-forward-word (- count))) |
(thai-forward-word (- count))) |
11040 |
|
|
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 |
|
|
11069 |
(provide 'thai-word) |
(provide 'thai-word) |
11070 |
|
|
11071 |
|
|