(quail-thai-update-translation): Delete it.
authorKenichi Handa <handa@m17n.org>
Fri, 18 Mar 2005 06:54:25 +0000 (06:54 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 18 Mar 2005 06:54:25 +0000 (06:54 +0000)
(thai-generate-quail-map): Generate is simple map.
("thai-kesmanee"): Don't use quail-thai-update-translation.
(thai-generate-quail-map): Likewise.

leim/quail/thai.el
lisp/ChangeLog

index c147ad3..dbef1b3 100644 (file)
@@ -2,6 +2,9 @@
 
 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
+;; Copyright (C) 2005
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: multilingual, input method, Thai
 
 (require 'quail)
 (require 'thai-util)
 
-(defun quail-thai-update-translation (control-flag)
-  (if (integerp control-flag)
-      ;; Non-composable character typed.
-      (setq quail-current-str
-           (buffer-substring (overlay-start quail-overlay)
-                             (overlay-end quail-overlay))
-           unread-command-events
-           (string-to-list
-            (substring quail-current-key control-flag)))
-    (setq quail-current-str
-         (compose-string (quail-lookup-map-and-concat quail-current-key))))
-  control-flag)
-
-(defun thai-generate-quail-map (translation-table)
-  (let ((i 0)
-       consonant vowel tone voweltone others)
-    ;; Categorize Thai characters into one of above.
-    (while (< i 128)
-      (let ((trans (aref translation-table i))
-           ptype)
-       (if (eq trans 0)
-           nil
-         (if (> (length trans) 1)
-             (setq ptype 'voweltone
-                   trans (vector (compose-string trans)))
-           (setq ptype (get-char-code-property (aref trans 0) 'phonetic-type))
-           (cond ((memq ptype '(vowel-upper vowel-lower))
-                  (setq ptype 'vowel))
-                 ((not (memq ptype '(consonant tone)))
-                  (setq ptype 'others))))
-         (set ptype (cons (cons (char-to-string i) trans)
-                          (symbol-value ptype)))))
-      (setq i (1+ i)))
-
-    (quail-map-from-table
-     '((base-state (consonant . vt-state)
-                  vowel tone voweltone others)
-       (vt-state (vowel . t-state)
-                voweltone tone)
-       (t-state tone)))))
+(defmacro thai-generate-quail-map (translation-table)
+  (let (map)
+     (dotimes (i (length translation-table))
+       (let ((trans (aref translation-table i)))
+        (when (not (eq trans 0))
+          (if (> (length trans) 1)
+              (setq trans (vector trans))
+            (setq trans (aref trans 0)))
+          (setq map (cons (list (char-to-string i) trans) map)))))
+     `(quail-define-rules ,@map)))
 
 ;; Thai Kesmanee keyboard support.
 
@@ -80,7 +53,7 @@ The difference from the ordinal Thai keyboard:
     '\e,T_\e(B' and '\e,To\e(B' are assigned to '\\' and '|' respectively,
     '\e,T#\e(B' and '\e,T%\e(B' are assigned to '`' and '~' respectively,
     Don't know where to assign characters '\e,Tz\e(B' and '\e,T{\e(B'."
- nil t t t t nil nil nil 'quail-thai-update-translation nil t)
+ nil t t t t nil nil nil nil nil t)
 
 (quail-install-map
  (thai-generate-quail-map
@@ -122,7 +95,7 @@ The difference from the ordinal Thai keyboard:
 (quail-define-package
  "thai-pattachote" "Thai" "\e,T!;\e(B>" t
  "Thai Pattachote input method with TIS620 keyboard layout"
- nil t t t t nil nil nil 'quail-thai-update-translation nil t)
+ nil t t t t nil nil nil nil nil t)
 
 (quail-install-map
  (thai-generate-quail-map
index 2bbb18b..74c4307 100644 (file)
@@ -1,3 +1,21 @@
+2005-03-18  handa  <handa@m17n.org>
+
+       * language/thai-util.el: Fix categorization of Thai characters in
+       thai-category-table.
+       (thai-composition-pattern): Adjust it for the above change.
+       (thai-self-insert-command, thai-compose-syllable): New functions.
+       (thai-compose-region): Use thai-compose-syllable.
+       (thai-compose-string): Likewise.
+       (thai-composition-function): Likewise.
+       (thai-auto-composition): New function.
+       (thai-auto-composition-mode): New minor mode.
+
+       * language/thai.el: Fix patterns to be registered in
+       composition-function-table.
+
+       * international/quail.el (quail-input-method): Locally bind
+       inhibit-modification-hooks to t.
+
 2005-03-17  Richard M. Stallman  <rms@gnu.org>
 
        * progmodes/perl-mode.el (perl-mode-hook): Defvar it.