-(eval-and-compile
-
-(defvar thai-keyboard-mapping-alist
- '((kesmanee
- [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 "#" "\e,TF\e(B" "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e0\e,TQi\e1\e(B" "\e,T'\e(B" ; SPC .. '
- "\e,Tv\e(B" "\e,Tw\e(B" "\e,Tu\e(B" "\e,Ty\e(B" "\e,TA\e(B" "\e,T"\e(B" "\e,Tc\e(B" "\e,T=\e(B" ; ( .. /
- "\e,T(\e(B" "\e,TE\e(B" "/" "_" "\e,T@\e(B" "\e,T6\e(B" "\e,TX\e(B" "\e,TV\e(B" ; 0 .. 7
- "\e,T$\e(B" "\e,T5\e(B" "\e,T+\e(B" "\e,TG\e(B" "\e,T2\e(B" "\e,T*\e(B" "\e,TL\e(B" "\e,TF\e(B" ; 8 .. ?
- "\e,Tq\e(B" "\e,TD\e(B" "\e,TZ\e(B" "\e,T)\e(B" "\e,T/\e(B" "\e,T.\e(B" "\e,Tb\e(B" "\e,T,\e(B" ; @ .. G
- "\e,Tg\e(B" "\e,T3\e(B" "\e,Tk\e(B" "\e,TI\e(B" "\e,TH\e(B" "\e,Tn\e(B" "\e,Tl\e(B" "\e,TO\e(B" ; H .. O
- "\e,T-\e(B" "\e,Tp\e(B" "\e,T1\e(B" "\e,T&\e(B" "\e,T8\e(B" "\e,Tj\e(B" "\e,TN\e(B" "\"" ; P .. W
- ")" "\e,Tm\e(B" "(" "\e,T:\e(B" "\e,T_\e(B" "\e,TE\e(B" "\e,TY\e(B" "\e,Tx\e(B" ; X .. _
- "\e,T#\e(B" "\e,T?\e(B" "\e,TT\e(B" "\e,Ta\e(B" "\e,T!\e(B" "\e,TS\e(B" "\e,T4\e(B" "\e,T`\e(B" ; ` .. g
- "\e,Ti\e(B" "\e,TC\e(B" "\e,Th\e(B" "\e,TR\e(B" "\e,TJ\e(B" "\e,T7\e(B" "\e,TW\e(B" "\e,T9\e(B" ; h .. o
- "\e,TB\e(B" "\e,Tf\e(B" "\e,T>\e(B" "\e,TK\e(B" "\e,TP\e(B" "\e,TU\e(B" "\e,TM\e(B" "\e,Td\e(B" ; p .. w
- "\e,T;\e(B" "\e,TQ\e(B" "\e,T<\e(B" "\e,T0\e(B" "\e,To\e(B" "." "\e,T%\e(B" 0] ; x .. DEL
- nil nil)
-
- (pattachote
- [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
- 0 "+" "\e,T1\e(B" "/" "," "?" "_" "\e,T"\e(B" ; SPC .. '
- "(" ")" "." "%" "\e,TP\e(B" "\e,Tq\e(B" "\e,T(\e(B" "\e,T>\e(B" ; ( .. /
- "\e,Tp\e(B" "=" "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,Tu\e(B" "\e,TY\e(B" "\e,Tw\e(B" ; 0 .. 7
- "\e,Tx\e(B" "\e,Ty\e(B" "\e,T&\e(B" "\e,Td\e(B" "\e,T?\e(B" "\e,Tv\e(B" "\e,T2\e(B" "\e,TL\e(B" ; 8 .. ?
- "\"" "\e,Tk\e(B" "\e,TQ\e(B" "\e,T0\e(B" "\e,TS\e(B" "\e,Tf\e(B" "\e,T3\e(B" "\e,Tl\e(B" ; @ .. G
- "\e,TW\e(B" "\e,T+\e(B" "\e,T<\e(B" "\e,T*\e(B" "\e,Tb\e(B" "\e,TN\e(B" "\e,TH\e(B" "\e,T6\e(B" ; H .. O
- "\e,T2\e(B" "\e,Tj\e(B" "\e,T-\e(B" "\e,T8\e(B" "\e,TI\e(B" "\e,T=\e(B" "\e,T@\e(B" "\e,TD\e(B" ; P .. W
- "\e,T.\e(B" "\e,TV\e(B" "\e,T.\e(B" "\e,Tc\e(B" "\e,TZ\e(B" "\e,T2\e(B" "\e,TX\e(B" "-" ; X .. _
- "\e,T#\e(B" "\e,Ti\e(B" "\e,TT\e(B" "\e,TE\e(B" "\e,T'\e(B" "\e,TB\e(B" "\e,T!\e(B" "\e,TQ\e(B" ; ` .. g
- "\e,TU\e(B" "\e,TA\e(B" "\e,TR\e(B" "\e,T9\e(B" "\e,T`\e(B" "\e,TJ\e(B" "\e,T$\e(B" "\e,TG\e(B" ; h .. o
- "\e,Ta\e(B" "\e,Tg\e(B" "\e,TM\e(B" "\e,T7\e(B" "\e,TC\e(B" "\e,T4\e(B" "\e,TK\e(B" "\e,T5\e(B" ; p .. w
- "\e,T;\e(B" "\e,Th\e(B" "\e,T:\e(B" "\e,TO\e(B" "\e,Tm\e(B" "\e,TF\e(B" "\e,T%\e(B" 0] ; x .. DEL
- nil nil)
- )
- "Alist of Thai keyboard types vs. corresponding mapping tables.
-Each element is a list of:
- KEYBOARD-TYPE, ASCII-THAI-TABLE, CONSONANT-MAP-TEMPLATE,
- and VOWEL-UPPER-LOWER-TEMPLATE.
-
-KEYBOARD-TYPE is a symbol, one of kesmanee or pattachote.
-
-ASCII-THAI-TABLE is a vector indexed by an ASCII key code
-and the value is the one-char string of Thai character
-assigned at the location of ASCII key on the specific Thai keyboard.
-The value is 0 if no Thai character is assigned at the location.
-
-CONSONANT-MAP-TEMPLATE is a template of a cdr part of a Quail map when
-a consonant is entered.
-
-VOWEL-UPPER-LOWER-TEMPLATE is a template of a cdr part of a Quail map
-when a vowel upper or a vowel lower is entered.")
-
-(defmacro thai-keyboard-info (keyboard-type)
- `(assq ,keyboard-type thai-keyboard-mapping-alist))
-
-)
-
-(defvar thai-current-keyboard-type nil
- "Thai Keyboard type which Quail is assuming currently.
-This variable is used in Quail internally only.")
-
-;; Template of a cdr part of a Quail map when a consonant is entered.
-(defvar thai-consonant-alist nil)
-;; Template of a cdr part of a Quail map when a vowel upper or a vowel
-;; lower is entered.
-(defvar thai-vowel-upper-lower-alist nil)
-
-;; Return a Quail map corresponding to KEY of length LEN.
-;; The car part of the map is a translation generated automatically.
-;; The cdr part of the map is a copy of ALIST.
-(defun thai-generate-quail-map (key len alist)
- (let ((str "")
- (idx 0))
- (while (< idx len)
- (setq str (concat str (aref (nth 1 (thai-keyboard-info
- thai-current-keyboard-type))
- (aref key idx)))
- idx (1+ idx)))
- (cons (string-to-char (compose-string str)) (copy-alist alist))))
-
-;; Return a Quail map corresponding to KEY of length LEN when Thai
-;; tone mark is entered.
-(defun thai-tone-input (key len)
- (thai-generate-quail-map key len nil))