Commit | Line | Data |
---|---|---|
be567141 | 1 | ;;; thai.el --- Quail package for inputting Thai characters |
24b31c88 KH |
2 | |
3 | ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
4 | ;; Licensed to the Free Software Foundation. | |
1ab06fdf KH |
5 | ;; Copyright (C) 2005 |
6 | ;; National Institute of Advanced Industrial Science and Technology (AIST) | |
7 | ;; Registration Number H14PRO021 | |
24b31c88 KH |
8 | |
9 | ;; Keywords: multilingual, input method, Thai | |
10 | ||
11 | ;; This file is part of GNU Emacs. | |
12 | ||
13 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
14 | ;; it under the terms of the GNU General Public License as published by | |
15 | ;; the Free Software Foundation; either version 2, or (at your option) | |
16 | ;; any later version. | |
17 | ||
18 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | ;; GNU General Public License for more details. | |
22 | ||
23 | ;; You should have received a copy of the GNU General Public License | |
24 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
364c38d3 LK |
25 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 | ;; Boston, MA 02110-1301, USA. | |
24b31c88 | 27 | |
be567141 PJ |
28 | ;;; Commentary: |
29 | ||
24b31c88 KH |
30 | ;;; Code: |
31 | ||
32 | (require 'quail) | |
33 | (require 'thai-util) | |
34 | ||
1ab06fdf KH |
35 | (defmacro thai-generate-quail-map (translation-table) |
36 | (let (map) | |
37 | (dotimes (i (length translation-table)) | |
38 | (let ((trans (aref translation-table i))) | |
39 | (when (not (eq trans 0)) | |
40 | (if (> (length trans) 1) | |
41 | (setq trans (vector trans)) | |
42 | (setq trans (aref trans 0))) | |
43 | (setq map (cons (list (char-to-string i) trans) map))))) | |
44 | `(quail-define-rules ,@map))) | |
24b31c88 | 45 | |
24b31c88 KH |
46 | ;; Thai Kesmanee keyboard support. |
47 | ||
48 | (quail-define-package | |
49 | "thai-kesmanee" "Thai" "\e,T!!\e(B>" t | |
50 | "Thai Kesmanee input method with TIS620 keyboard layout | |
51 | ||
52 | The difference from the ordinal Thai keyboard: | |
53 | '\e,T_\e(B' and '\e,To\e(B' are assigned to '\\' and '|' respectively, | |
54 | '\e,T#\e(B' and '\e,T%\e(B' are assigned to '`' and '~' respectively, | |
55 | Don't know where to assign characters '\e,Tz\e(B' and '\e,T{\e(B'." | |
1ab06fdf | 56 | nil t t t t nil nil nil nil nil t) |
653b6bad | 57 | |
177c0ea7 | 58 | (quail-install-map |
653b6bad KH |
59 | (thai-generate-quail-map |
60 | [ | |
61 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes | |
62 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes | |
ca9d3585 KH |
63 | ;; This data is quite old. |
64 | ;; 0 "#" "." "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,TQi\e(B" "\e,T'\e(B" ; SPC .. ' | |
65 | ;; "\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" ; ( .. / | |
66 | ;; "\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 | |
67 | ;; "\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 .. ? | |
68 | ;; "\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 | |
69 | ;; "\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 | |
70 | ;; "\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 | |
71 | ;; ")" "\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 .. _ | |
72 | ;; "\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 | |
73 | ;; "\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 | |
74 | ;; "\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 | |
75 | ;; "\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 | |
76 | ;; This is the correct data nowadays. | |
77 | 0 "+" "." "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,T_\e(B" "\e,T'\e(B" ; SPC .. ' | |
653b6bad | 78 | "\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" ; ( .. / |
ca9d3585 | 79 | "\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 |
653b6bad | 80 | "\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 .. ? |
761a8755 KH |
81 | "\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 |
82 | "\e,Tg\e(B" "\e,T3\e(B" "\e,Tk\e(B" "\e,TI\e(B" "\e,TH\e(B" "?" "\e,Tl\e(B" "\e,TO\e(B" ; H .. O | |
653b6bad | 83 | "\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 |
761a8755 KH |
84 | "\)" "\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 .. _ |
85 | "_" "\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 | |
86 | "\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 | |
653b6bad | 87 | "\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 |
761a8755 | 88 | "\e,T;\e(B" "\e,TQ\e(B" "\e,T<\e(B" "\e,T0\e(B" "\e,T%\e(B" "," "%" 0 ; x .. DEL |
653b6bad | 89 | ])) |
24b31c88 | 90 | |
24b31c88 KH |
91 | |
92 | \f | |
93 | ;; Thai Pattachote keyboard support. | |
94 | ||
95 | (quail-define-package | |
96 | "thai-pattachote" "Thai" "\e,T!;\e(B>" t | |
97 | "Thai Pattachote input method with TIS620 keyboard layout" | |
1ab06fdf | 98 | nil t t t t nil nil nil nil nil t) |
653b6bad | 99 | |
177c0ea7 | 100 | (quail-install-map |
653b6bad KH |
101 | (thai-generate-quail-map |
102 | [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes | |
103 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes | |
104 | 0 "+" "\e,T1\e(B" "/" "," "?" "_" "\e,T"\e(B" ; SPC .. ' | |
105 | "(" ")" "." "%" "\e,TP\e(B" "\e,Tq\e(B" "\e,T(\e(B" "\e,T>\e(B" ; ( .. / | |
106 | "\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 | |
107 | "\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 .. ? | |
108 | "\"" "\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 | |
109 | "\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 | |
110 | "\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 | |
111 | "\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 .. _ | |
112 | "\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 | |
113 | "\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 | |
114 | "\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 | |
115 | "\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 | |
116 | ])) | |
be567141 | 117 | |
ab5796a9 | 118 | ;;; arch-tag: fed6c468-0616-44b0-88bf-47347bf64825 |
be567141 | 119 | ;;; thai.el ends here |