38453
|
1 ;;; thai.el --- Quail package for inputting Thai characters
|
18673
|
2
|
74605
|
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
75253
|
4 ;; 2005, 2006, 2007
|
60704
|
5 ;; National Institute of Advanced Industrial Science and Technology (AIST)
|
|
6 ;; Registration Number H14PRO021
|
18673
|
7
|
|
8 ;; Keywords: multilingual, input method, Thai
|
|
9
|
|
10 ;; This file is part of GNU Emacs.
|
|
11
|
|
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
13 ;; it under the terms of the GNU General Public License as published by
|
78308
|
14 ;; the Free Software Foundation; either version 3, or (at your option)
|
18673
|
15 ;; any later version.
|
|
16
|
|
17 ;; GNU Emacs is distributed in the hope that it will be useful,
|
|
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20 ;; GNU General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
|
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
|
64083
|
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
25 ;; Boston, MA 02110-1301, USA.
|
18673
|
26
|
38453
|
27 ;;; Commentary:
|
|
28
|
18673
|
29 ;;; Code:
|
|
30
|
|
31 (require 'quail)
|
|
32 (require 'thai-util)
|
|
33
|
60704
|
34 (defmacro thai-generate-quail-map (translation-table)
|
|
35 (let (map)
|
|
36 (dotimes (i (length translation-table))
|
|
37 (let ((trans (aref translation-table i)))
|
|
38 (when (not (eq trans 0))
|
|
39 (if (> (length trans) 1)
|
|
40 (setq trans (vector trans))
|
|
41 (setq trans (aref trans 0)))
|
|
42 (setq map (cons (list (char-to-string i) trans) map)))))
|
|
43 `(quail-define-rules ,@map)))
|
18673
|
44
|
|
45 ;; Thai Kesmanee keyboard support.
|
|
46
|
|
47 (quail-define-package
|
|
48 "thai-kesmanee" "Thai" ",T!!(B>" t
|
|
49 "Thai Kesmanee input method with TIS620 keyboard layout
|
|
50
|
|
51 The difference from the ordinal Thai keyboard:
|
|
52 ',T_(B' and ',To(B' are assigned to '\\' and '|' respectively,
|
|
53 ',T#(B' and ',T%(B' are assigned to '`' and '~' respectively,
|
|
54 Don't know where to assign characters ',Tz(B' and ',T{(B'."
|
60704
|
55 nil t t t t nil nil nil nil nil t)
|
18673
|
56
|
49600
|
57 (quail-install-map
|
26881
|
58 (thai-generate-quail-map
|
|
59 [
|
|
60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
|
|
61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
|
60605
|
62 ;; This data is quite old.
|
|
63 ;; 0 "#" "." ",Tr(B" ",Ts(B" ",Tt(B" ",TQi(B" ",T'(B" ; SPC .. '
|
|
64 ;; ",Tv(B" ",Tw(B" ",Tu(B" ",Ty(B" ",TA(B" ",T"(B" ",Tc(B" ",T=(B" ; ( .. /
|
|
65 ;; ",T((B" ",TE(B" "/" "_" ",T@(B" ",T6(B" ",TX(B" ",TV(B" ; 0 .. 7
|
|
66 ;; ",T$(B" ",T5(B" ",T+(B" ",TG(B" ",T2(B" ",T*(B" ",TL(B" ",TF(B" ; 8 .. ?
|
|
67 ;; ",Tq(B" ",TD(B" ",TZ(B" ",T)(B" ",T/(B" ",T.(B" ",Tb(B" ",T,(B" ; @ .. G
|
|
68 ;; ",Tg(B" ",T3(B" ",Tk(B" ",TI(B" ",TH(B" ",Tn(B" ",Tl(B" ",TO(B" ; H .. O
|
|
69 ;; ",T-(B" ",Tp(B" ",T1(B" ",T&(B" ",T8(B" ",Tj(B" ",TN(B" "\"" ; P .. W
|
|
70 ;; ")" ",Tm(B" "(" ",T:(B" ",T_(B" ",TE(B" ",TY(B" ",Tx(B" ; X .. _
|
|
71 ;; ",T#(B" ",T?(B" ",TT(B" ",Ta(B" ",T!(B" ",TS(B" ",T4(B" ",T`(B" ; ` .. g
|
|
72 ;; ",Ti(B" ",TC(B" ",Th(B" ",TR(B" ",TJ(B" ",T7(B" ",TW(B" ",T9(B" ; h .. o
|
|
73 ;; ",TB(B" ",Tf(B" ",T>(B" ",TK(B" ",TP(B" ",TU(B" ",TM(B" ",Td(B" ; p .. w
|
|
74 ;; ",T;(B" ",TQ(B" ",T<(B" ",T0(B" ",To(B" "," ",T%(B" 0 ; x .. DEL
|
|
75 ;; This is the correct data nowadays.
|
|
76 0 "+" "." ",Tr(B" ",Ts(B" ",Tt(B" ",T_(B" ",T'(B" ; SPC .. '
|
26881
|
77 ",Tv(B" ",Tw(B" ",Tu(B" ",Ty(B" ",TA(B" ",T"(B" ",Tc(B" ",T=(B" ; ( .. /
|
60605
|
78 ",T((B" ",Te(B" "/" "-" ",T@(B" ",T6(B" ",TX(B" ",TV(B" ; 0 .. 7
|
26881
|
79 ",T$(B" ",T5(B" ",T+(B" ",TG(B" ",T2(B" ",T*(B" ",TL(B" ",TF(B" ; 8 .. ?
|
60606
|
80 ",Tq(B" ",TD(B" ",TZ(B" ",T)(B" ",T/(B" ",T.(B" ",Tb(B" ",T,(B" ; @ .. G
|
|
81 ",Tg(B" ",T3(B" ",Tk(B" ",TI(B" ",TH(B" "?" ",Tl(B" ",TO(B" ; H .. O
|
26881
|
82 ",T-(B" ",Tp(B" ",T1(B" ",T&(B" ",T8(B" ",Tj(B" ",TN(B" "\"" ; P .. W
|
60606
|
83 "\)" ",Tm(B" "\(" ",T:(B" ",T#(B" ",TE(B" ",TY(B" ",Tx(B" ; X .. _
|
|
84 "_" ",T?(B" ",TT(B" ",Ta(B" ",T!(B" ",TS(B" ",T4(B" ",T`(B" ; ` .. g
|
|
85 ",Ti(B" ",TC(B" ",Th(B" ",TR(B" ",TJ(B" ",T7(B" ",TW(B" ",T9(B" ; h .. o
|
26881
|
86 ",TB(B" ",Tf(B" ",T>(B" ",TK(B" ",TP(B" ",TU(B" ",TM(B" ",Td(B" ; p .. w
|
60606
|
87 ",T;(B" ",TQ(B" ",T<(B" ",T0(B" ",T%(B" "," "%" 0 ; x .. DEL
|
26881
|
88 ]))
|
18673
|
89
|
|
90
|
|
91
|
|
92 ;; Thai Pattachote keyboard support.
|
|
93
|
|
94 (quail-define-package
|
|
95 "thai-pattachote" "Thai" ",T!;(B>" t
|
|
96 "Thai Pattachote input method with TIS620 keyboard layout"
|
60704
|
97 nil t t t t nil nil nil nil nil t)
|
18673
|
98
|
49600
|
99 (quail-install-map
|
26881
|
100 (thai-generate-quail-map
|
|
101 [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
|
|
102 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
|
|
103 0 "+" ",T1(B" "/" "," "?" "_" ",T"(B" ; SPC .. '
|
|
104 "(" ")" "." "%" ",TP(B" ",Tq(B" ",T((B" ",T>(B" ; ( .. /
|
|
105 ",Tp(B" "=" ",Tr(B" ",Ts(B" ",Tt(B" ",Tu(B" ",TY(B" ",Tw(B" ; 0 .. 7
|
|
106 ",Tx(B" ",Ty(B" ",T&(B" ",Td(B" ",T?(B" ",Tv(B" ",T2(B" ",TL(B" ; 8 .. ?
|
|
107 "\"" ",Tk(B" ",TQ(B" ",T0(B" ",TS(B" ",Tf(B" ",T3(B" ",Tl(B" ; @ .. G
|
|
108 ",TW(B" ",T+(B" ",T<(B" ",T*(B" ",Tb(B" ",TN(B" ",TH(B" ",T6(B" ; H .. O
|
|
109 ",T2(B" ",Tj(B" ",T-(B" ",T8(B" ",TI(B" ",T=(B" ",T@(B" ",TD(B" ; P .. W
|
|
110 ",T.(B" ",TV(B" ",T.(B" ",Tc(B" ",TZ(B" ",T2(B" ",TX(B" "-" ; X .. _
|
|
111 ",T#(B" ",Ti(B" ",TT(B" ",TE(B" ",T'(B" ",TB(B" ",T!(B" ",TQ(B" ; ` .. g
|
|
112 ",TU(B" ",TA(B" ",TR(B" ",T9(B" ",T`(B" ",TJ(B" ",T$(B" ",TG(B" ; h .. o
|
|
113 ",Ta(B" ",Tg(B" ",TM(B" ",T7(B" ",TC(B" ",T4(B" ",TK(B" ",T5(B" ; p .. w
|
|
114 ",T;(B" ",Th(B" ",T:(B" ",TO(B" ",Tm(B" ",TF(B" ",T%(B" 0 ; x .. DEL
|
|
115 ]))
|
38453
|
116
|
52401
|
117 ;;; arch-tag: fed6c468-0616-44b0-88bf-47347bf64825
|
38453
|
118 ;;; thai.el ends here
|