lisp/gnus/gnus-art.el (gnus-article-browse-html-parts): Replace LWSPs with `&nbsp...
[bpt/emacs.git] / leim / quail / thai.el
1 ;;; thai.el --- Quail package for inputting Thai characters -*-coding: utf-8;-*-
2
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
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 of the License, or
15 ;; (at your option) 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. If not, see <http://www.gnu.org/licenses/>.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (require 'quail)
30
31 (defmacro thai-generate-quail-map (translation-table)
32 (let (map)
33 (dotimes (i (length translation-table))
34 (let ((trans (aref translation-table i)))
35 (when (not (eq trans 0))
36 (if (> (length trans) 1)
37 (setq trans (vector trans))
38 (setq trans (aref trans 0)))
39 (setq map (cons (list (char-to-string i) trans) map)))))
40 `(quail-define-rules ,@map)))
41
42 ;; Thai Kesmanee keyboard support.
43
44 (quail-define-package
45 "thai-kesmanee" "Thai" "กก>" t
46 "Thai Kesmanee input method with TIS620 keyboard layout
47
48 The difference from the ordinal Thai keyboard:
49 '฿' and '๏' are assigned to '\\' and '|' respectively,
50 'ฃ' and 'ฅ' are assigned to '`' and '~' respectively,
51 Don't know where to assign characters '๚' and '๛'."
52 nil t t t t nil nil nil nil nil t)
53
54 (thai-generate-quail-map
55 [
56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
57 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
58 ;; This data is quite old.
59 ;; 0 "#" "." "๒" "๓" "๔" "ั้" "ง" ; SPC .. '
60 ;; "๖" "๗" "๕" "๙" "ม" "ข" "ใ" "ฝ" ; ( .. /
61 ;; "จ" "ล" "/" "_" "ภ" "ถ" "ุ" "ึ" ; 0 .. 7
62 ;; "ค" "ต" "ซ" "ว" "ฒ" "ช" "ฬ" "ฦ" ; 8 .. ?
63 ;; "๑" "ฤ" "ฺ" "ฉ" "ฏ" "ฎ" "โ" "ฌ" ; @ .. G
64 ;; "็" "ณ" "๋" "ษ" "ศ" "๎" "์" "ฯ" ; H .. O
65 ;; "ญ" "๐" "ฑ" "ฆ" "ธ" "๊" "ฮ" "\"" ; P .. W
66 ;; ")" "ํ" "(" "บ" "฿" "ล" "ู" "๘" ; X .. _
67 ;; "ฃ" "ฟ" "ิ" "แ" "ก" "ำ" "ด" "เ" ; ` .. g
68 ;; "้" "ร" "่" "า" "ส" "ท" "ื" "น" ; h .. o
69 ;; "ย" "ๆ" "พ" "ห" "ะ" "ี" "อ" "ไ" ; p .. w
70 ;; "ป" "ั" "ผ" "ฐ" "๏" "," "ฅ" 0 ; x .. DEL
71 ;; This is the correct data nowadays.
72 0 "+" "." "๒" "๓" "๔" "฿" "ง" ; SPC .. '
73 "๖" "๗" "๕" "๙" "ม" "ข" "ใ" "ฝ" ; ( .. /
74 "จ" "ๅ" "/" "-" "ภ" "ถ" "ุ" "ึ" ; 0 .. 7
75 "ค" "ต" "ซ" "ว" "ฒ" "ช" "ฬ" "ฦ" ; 8 .. ?
76 "๑" "ฤ" "ฺ" "ฉ" "ฏ" "ฎ" "โ" "ฌ" ; @ .. G
77 "็" "ณ" "๋" "ษ" "ศ" "?" "์" "ฯ" ; H .. O
78 "ญ" "๐" "ฑ" "ฆ" "ธ" "๊" "ฮ" "\"" ; P .. W
79 "\)" "ํ" "\(" "บ" "ฃ" "ล" "ู" "๘" ; X .. _
80 "_" "ฟ" "ิ" "แ" "ก" "ำ" "ด" "เ" ; ` .. g
81 "้" "ร" "่" "า" "ส" "ท" "ื" "น" ; h .. o
82 "ย" "ๆ" "พ" "ห" "ะ" "ี" "อ" "ไ" ; p .. w
83 "ป" "ั" "ผ" "ฐ" "ฅ" "," "%" 0 ; x .. DEL
84 ])
85
86
87 ;; Thai Pattachote keyboard support.
88
89 (quail-define-package
90 "thai-pattachote" "Thai" "กป>" t
91 "Thai Pattachote input method with TIS620 keyboard layout"
92 nil t t t t nil nil nil nil nil t)
93
94 (thai-generate-quail-map
95 [
96 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes
98 0 "+" "ฑ" "/" "," "?" "_" "ข" ; SPC .. '
99 "(" ")" "." "%" "ะ" "๑" "จ" "พ" ; ( .. /
100 "๐" "=" "๒" "๓" "๔" "๕" "ู" "๗" ; 0 .. 7
101 "๘" "๙" "ฆ" "ไ" "ฟ" "๖" "ฒ" "ฬ" ; 8 .. ?
102 "\"" "๋" "ั" "ฐ" "ำ" "ๆ" "ณ" "์" ; @ .. G
103 "ื" "ซ" "ผ" "ช" "โ" "ฮ" "ศ" "ถ" ; H .. O
104 "ฒ" "๊" "ญ" "ธ" "ษ" "ฝ" "ภ" "ฤ" ; P .. W
105 "ฎ" "ึ" "ฎ" "ใ" "ฺ" "ฒ" "ุ" "-" ; X .. _
106 "ฃ" "้" "ิ" "ล" "ง" "ย" "ก" "ั" ; ` .. g
107 "ี" "ม" "า" "น" "เ" "ส" "ค" "ว" ; h .. o
108 "แ" "็" "อ" "ท" "ร" "ด" "ห" "ต" ; p .. w
109 "ป" "่" "บ" "ฯ" "ํ" "ฦ" "ฅ" 0 ; x .. DEL
110 ])
111
112 ;;; thai.el ends here