| 1 | ;;; thai.el --- Quail package for inputting Thai characters |
| 2 | |
| 3 | ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006, 2007 |
| 5 | ;; National Institute of Advanced Industrial Science and Technology (AIST) |
| 6 | ;; Registration Number H14PRO021 |
| 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 |
| 14 | ;; the Free Software Foundation; either version 3 or (at your option) |
| 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 |
| 24 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 25 | ;; Boston, MA 02110-1301, USA. |
| 26 | |
| 27 | ;;; Commentary: |
| 28 | |
| 29 | ;;; Code: |
| 30 | |
| 31 | (require 'quail) |
| 32 | (require 'thai-util) |
| 33 | |
| 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))) |
| 44 | |
| 45 | ;; Thai Kesmanee keyboard support. |
| 46 | |
| 47 | (quail-define-package |
| 48 | "thai-kesmanee" "Thai" "\e,T!!\e(B>" t |
| 49 | "Thai Kesmanee input method with TIS620 keyboard layout |
| 50 | |
| 51 | The difference from the ordinal Thai keyboard: |
| 52 | '\e,T_\e(B' and '\e,To\e(B' are assigned to '\\' and '|' respectively, |
| 53 | '\e,T#\e(B' and '\e,T%\e(B' are assigned to '`' and '~' respectively, |
| 54 | Don't know where to assign characters '\e,Tz\e(B' and '\e,T{\e(B'." |
| 55 | nil t t t t nil nil nil nil nil t) |
| 56 | |
| 57 | (quail-install-map |
| 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 |
| 62 | ;; This data is quite old. |
| 63 | ;; 0 "#" "." "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,TQi\e(B" "\e,T'\e(B" ; SPC .. ' |
| 64 | ;; "\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" ; ( .. / |
| 65 | ;; "\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 |
| 66 | ;; "\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 .. ? |
| 67 | ;; "\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 |
| 68 | ;; "\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 |
| 69 | ;; "\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 |
| 70 | ;; ")" "\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 .. _ |
| 71 | ;; "\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 |
| 72 | ;; "\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 |
| 73 | ;; "\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 |
| 74 | ;; "\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 |
| 75 | ;; This is the correct data nowadays. |
| 76 | 0 "+" "." "\e,Tr\e(B" "\e,Ts\e(B" "\e,Tt\e(B" "\e,T_\e(B" "\e,T'\e(B" ; SPC .. ' |
| 77 | "\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" ; ( .. / |
| 78 | "\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 |
| 79 | "\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 .. ? |
| 80 | "\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 |
| 81 | "\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 |
| 82 | "\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 |
| 83 | "\)" "\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 .. _ |
| 84 | "_" "\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 |
| 85 | "\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 |
| 86 | "\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 |
| 87 | "\e,T;\e(B" "\e,TQ\e(B" "\e,T<\e(B" "\e,T0\e(B" "\e,T%\e(B" "," "%" 0 ; x .. DEL |
| 88 | ])) |
| 89 | |
| 90 | |
| 91 | \f |
| 92 | ;; Thai Pattachote keyboard support. |
| 93 | |
| 94 | (quail-define-package |
| 95 | "thai-pattachote" "Thai" "\e,T!;\e(B>" t |
| 96 | "Thai Pattachote input method with TIS620 keyboard layout" |
| 97 | nil t t t t nil nil nil nil nil t) |
| 98 | |
| 99 | (quail-install-map |
| 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 "+" "\e,T1\e(B" "/" "," "?" "_" "\e,T"\e(B" ; SPC .. ' |
| 104 | "(" ")" "." "%" "\e,TP\e(B" "\e,Tq\e(B" "\e,T(\e(B" "\e,T>\e(B" ; ( .. / |
| 105 | "\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 |
| 106 | "\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 .. ? |
| 107 | "\"" "\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 |
| 108 | "\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 |
| 109 | "\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 |
| 110 | "\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 .. _ |
| 111 | "\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 |
| 112 | "\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 |
| 113 | "\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 |
| 114 | "\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 |
| 115 | ])) |
| 116 | |
| 117 | ;;; arch-tag: fed6c468-0616-44b0-88bf-47347bf64825 |
| 118 | ;;; thai.el ends here |