diff options
| author | Kenichi Handa | 2005-03-18 06:54:25 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-03-18 06:54:25 +0000 |
| commit | 1ab06fdf11c104fff277ba0e109c8dc106a78d29 (patch) | |
| tree | 7ead17b6f096c517f23f89eb4360c21868b3906e | |
| parent | 8f9eda28ce69bcae4ad9c1b2663e160d733e1f04 (diff) | |
| download | emacs-1ab06fdf11c104fff277ba0e109c8dc106a78d29.tar.gz emacs-1ab06fdf11c104fff277ba0e109c8dc106a78d29.zip | |
(quail-thai-update-translation): Delete it.
(thai-generate-quail-map): Generate is simple map.
("thai-kesmanee"): Don't use quail-thai-update-translation.
(thai-generate-quail-map): Likewise.
| -rw-r--r-- | leim/quail/thai.el | 57 | ||||
| -rw-r--r-- | lisp/ChangeLog | 18 |
2 files changed, 33 insertions, 42 deletions
diff --git a/leim/quail/thai.el b/leim/quail/thai.el index c147ad308e9..dbef1b3d899 100644 --- a/leim/quail/thai.el +++ b/leim/quail/thai.el | |||
| @@ -2,6 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | 3 | ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
| 4 | ;; Licensed to the Free Software Foundation. | 4 | ;; Licensed to the Free Software Foundation. |
| 5 | ;; Copyright (C) 2005 | ||
| 6 | ;; National Institute of Advanced Industrial Science and Technology (AIST) | ||
| 7 | ;; Registration Number H14PRO021 | ||
| 5 | 8 | ||
| 6 | ;; Keywords: multilingual, input method, Thai | 9 | ;; Keywords: multilingual, input method, Thai |
| 7 | 10 | ||
| @@ -29,46 +32,16 @@ | |||
| 29 | (require 'quail) | 32 | (require 'quail) |
| 30 | (require 'thai-util) | 33 | (require 'thai-util) |
| 31 | 34 | ||
| 32 | (defun quail-thai-update-translation (control-flag) | 35 | (defmacro thai-generate-quail-map (translation-table) |
| 33 | (if (integerp control-flag) | 36 | (let (map) |
| 34 | ;; Non-composable character typed. | 37 | (dotimes (i (length translation-table)) |
| 35 | (setq quail-current-str | 38 | (let ((trans (aref translation-table i))) |
| 36 | (buffer-substring (overlay-start quail-overlay) | 39 | (when (not (eq trans 0)) |
| 37 | (overlay-end quail-overlay)) | 40 | (if (> (length trans) 1) |
| 38 | unread-command-events | 41 | (setq trans (vector trans)) |
| 39 | (string-to-list | 42 | (setq trans (aref trans 0))) |
| 40 | (substring quail-current-key control-flag))) | 43 | (setq map (cons (list (char-to-string i) trans) map))))) |
| 41 | (setq quail-current-str | 44 | `(quail-define-rules ,@map))) |
| 42 | (compose-string (quail-lookup-map-and-concat quail-current-key)))) | ||
| 43 | control-flag) | ||
| 44 | |||
| 45 | (defun thai-generate-quail-map (translation-table) | ||
| 46 | (let ((i 0) | ||
| 47 | consonant vowel tone voweltone others) | ||
| 48 | ;; Categorize Thai characters into one of above. | ||
| 49 | (while (< i 128) | ||
| 50 | (let ((trans (aref translation-table i)) | ||
| 51 | ptype) | ||
| 52 | (if (eq trans 0) | ||
| 53 | nil | ||
| 54 | (if (> (length trans) 1) | ||
| 55 | (setq ptype 'voweltone | ||
| 56 | trans (vector (compose-string trans))) | ||
| 57 | (setq ptype (get-char-code-property (aref trans 0) 'phonetic-type)) | ||
| 58 | (cond ((memq ptype '(vowel-upper vowel-lower)) | ||
| 59 | (setq ptype 'vowel)) | ||
| 60 | ((not (memq ptype '(consonant tone))) | ||
| 61 | (setq ptype 'others)))) | ||
| 62 | (set ptype (cons (cons (char-to-string i) trans) | ||
| 63 | (symbol-value ptype))))) | ||
| 64 | (setq i (1+ i))) | ||
| 65 | |||
| 66 | (quail-map-from-table | ||
| 67 | '((base-state (consonant . vt-state) | ||
| 68 | vowel tone voweltone others) | ||
| 69 | (vt-state (vowel . t-state) | ||
| 70 | voweltone tone) | ||
| 71 | (t-state tone))))) | ||
| 72 | 45 | ||
| 73 | ;; Thai Kesmanee keyboard support. | 46 | ;; Thai Kesmanee keyboard support. |
| 74 | 47 | ||
| @@ -80,7 +53,7 @@ The difference from the ordinal Thai keyboard: | |||
| 80 | ',T_(B' and ',To(B' are assigned to '\\' and '|' respectively, | 53 | ',T_(B' and ',To(B' are assigned to '\\' and '|' respectively, |
| 81 | ',T#(B' and ',T%(B' are assigned to '`' and '~' respectively, | 54 | ',T#(B' and ',T%(B' are assigned to '`' and '~' respectively, |
| 82 | Don't know where to assign characters ',Tz(B' and ',T{(B'." | 55 | Don't know where to assign characters ',Tz(B' and ',T{(B'." |
| 83 | nil t t t t nil nil nil 'quail-thai-update-translation nil t) | 56 | nil t t t t nil nil nil nil nil t) |
| 84 | 57 | ||
| 85 | (quail-install-map | 58 | (quail-install-map |
| 86 | (thai-generate-quail-map | 59 | (thai-generate-quail-map |
| @@ -122,7 +95,7 @@ The difference from the ordinal Thai keyboard: | |||
| 122 | (quail-define-package | 95 | (quail-define-package |
| 123 | "thai-pattachote" "Thai" ",T!;(B>" t | 96 | "thai-pattachote" "Thai" ",T!;(B>" t |
| 124 | "Thai Pattachote input method with TIS620 keyboard layout" | 97 | "Thai Pattachote input method with TIS620 keyboard layout" |
| 125 | nil t t t t nil nil nil 'quail-thai-update-translation nil t) | 98 | nil t t t t nil nil nil nil nil t) |
| 126 | 99 | ||
| 127 | (quail-install-map | 100 | (quail-install-map |
| 128 | (thai-generate-quail-map | 101 | (thai-generate-quail-map |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2bbb18b1dfc..74c430734f2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2005-03-18 handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * language/thai-util.el: Fix categorization of Thai characters in | ||
| 4 | thai-category-table. | ||
| 5 | (thai-composition-pattern): Adjust it for the above change. | ||
| 6 | (thai-self-insert-command, thai-compose-syllable): New functions. | ||
| 7 | (thai-compose-region): Use thai-compose-syllable. | ||
| 8 | (thai-compose-string): Likewise. | ||
| 9 | (thai-composition-function): Likewise. | ||
| 10 | (thai-auto-composition): New function. | ||
| 11 | (thai-auto-composition-mode): New minor mode. | ||
| 12 | |||
| 13 | * language/thai.el: Fix patterns to be registered in | ||
| 14 | composition-function-table. | ||
| 15 | |||
| 16 | * international/quail.el (quail-input-method): Locally bind | ||
| 17 | inhibit-modification-hooks to t. | ||
| 18 | |||
| 1 | 2005-03-17 Richard M. Stallman <rms@gnu.org> | 19 | 2005-03-17 Richard M. Stallman <rms@gnu.org> |
| 2 | 20 | ||
| 3 | * progmodes/perl-mode.el (perl-mode-hook): Defvar it. | 21 | * progmodes/perl-mode.el (perl-mode-hook): Defvar it. |