]> code.delx.au - gnu-emacs/blob - leim/quail/thai.el
*** empty log message ***
[gnu-emacs] / leim / quail / thai.el
1 ;;; thai.el --- Quail package for inputting Thai characters -*-coding: iso-2022-7bit;-*-
2
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5
6 ;; Keywords: multilingual, input method, Thai
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (require 'quail)
30
31
32 (defmacro thai-generate-quail-map (translation-table)
33 (let (map)
34 (dotimes (i (length translation-table))
35 (let ((trans (aref translation-table i)))
36 (when (not (eq trans 0))
37 (if (> (length trans) 1)
38 (setq trans (vector trans))
39 (setq trans (aref trans 0)))
40 (setq map (cons (list (char-to-string i) trans) map)))))
41 `(quail-define-rules ,@map)))
42
43 ;; Thai Kesmanee keyboard support.
44
45 (quail-define-package
46 "thai-kesmanee" "Thai" "\e,T!!\e(B>" t
47 "Thai Kesmanee input method with TIS620 keyboard layout
48
49 The difference from the ordinal Thai keyboard:
50 '\e,T_\e(B' and '\e,To\e(B' are assigned to '\\' and '|' respectively,
51 '\e,T#\e(B' and '\e,T%\e(B' are assigned to '`' and '~' respectively,
52 Don't know where to assign characters '\e,Tz\e(B' and '\e,T{\e(B'."
53 nil t t t t nil nil nil nil nil t)
54
55 (thai-generate-quail-map
56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; h .. o
69 "\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
70 "\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
71 ])
72
73
74 \f
75 ;; Thai Pattachote keyboard support.
76
77 (quail-define-package
78 "thai-pattachote" "Thai" "\e,T!;\e(B>" t
79 "Thai Pattachote input method with TIS620 keyboard layout"
80 nil t t t t nil nil nil nil nil t)
81
82 (thai-generate-quail-map
83 [
84 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
86 0 "+" "\e,T1\e(B" "/" "," "?" "_" "\e,T"\e(B" ; SPC .. '
87 "(" ")" "." "%" "\e,TP\e(B" "\e,Tq\e(B" "\e,T(\e(B" "\e,T>\e(B" ; ( .. /
88 "\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
89 "\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 .. ?
90 "\"" "\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
91 "\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
92 "\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
93 "\e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