Mercurial > emacs
annotate leim/quail/lao.el @ 19860:c17fd465ea95 libc-970911 libc-970912 libc-970913 libc-970914 libc-970915 libc-970916 libc-970917 libc-970918 libc-970919 libc-970920 libc-970921 libc-970922 libc-970923 libc-970924 libc-970925 libc-970926 libc-970927 libc-970928 libc-970929 libc-970930 libc-971001 libc-971018 libc-971019 libc-971020 libc-971021 libc-971022 libc-971023 libc-971024 libc-971025 libc-971026 libc-971027 libc-971028 libc-971029 libc-971030 libc-971031 libc-971101 libc-971102 libc-971103 libc-971104 libc-971105 libc-971106 libc-971107 libc-971108 libc-971109 libc-971110 libc-971111 libc-971112 libc-971113 libc-971114 libc-971115 libc-971116 libc-971117 libc-971118 libc-971120 libc-971121 libc-971122 libc-971123 libc-971124 libc-971125 libc-971126 libc-971127 libc-971128 libc-971129 libc-971130 libc-971201 libc-971203 libc-971204 libc-971205 libc-971206 libc-971207 libc-971208 libc-971209 libc-971210 libc-971211 libc-971212 libc-971213 libc-971214 libc-971217 libc-971218 libc-971219 libc-971220 libc-971221 libc-971222 libc-971223 libc-971224 libc-971225 libc-971226 libc-971227 libc-971228 libc-971229 libc-971230 libc-971231 libc-980103 libc-980104 libc-980105 libc-980106 libc-980107 libc-980108 libc-980109 libc-980110 libc-980111 libc-980112 libc-980114 libc-980115 libc-980116 libc-980117 libc-980118 libc-980119 libc-980120 libc-980121 libc-980122 libc-980123 libc-980124 libc-980125 libc-980126 libc-980127 libc-980128
typos.
author | Jeff Law <law@redhat.com> |
---|---|
date | Wed, 10 Sep 1997 21:16:20 +0000 |
parents | dd39cae4cf0f |
children | cd1cb9bf30e1 |
rev | line source |
---|---|
18673 | 1 ;;; quail/lao.el --- Quail package for inputting Lao characters |
2 | |
3 ;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. | |
4 ;; Licensed to the Free Software Foundation. | |
5 | |
6 ;; Keywords: multilingual, input method, Lao | |
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 ;;; Code: | |
26 | |
27 (require 'quail) | |
28 (require 'lao-util) | |
29 | |
30 (eval-and-compile | |
31 | |
32 (defconst lao-keyboard-mapping | |
33 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes | |
34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ; control codes | |
35 0 "1" "=" "3" "4" "(1l(B" "5" "(1'(B" ; SPC .. ' | |
19374
b4eb3242ba6e
(lao-keyboard-mapping): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents:
19261
diff
changeset
|
36 "7" "8" "6" "(1mh(B" "(1A(B" "(1*(B" "(1c(B" "(1=(B" ; ( .. / |
18673 | 37 "(1"(B" "(1B(B" "(1?(B" "(1b(B" "(16(B" "(1X(B" "(1Y(B" "(1$(B" ; 0 .. 7 |
19374
b4eb3242ba6e
(lao-keyboard-mapping): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents:
19261
diff
changeset
|
38 "(15(B" "(1((B" "%" "(1G(B" "(1}(B" "(1m(B" "$" "\)" ; 8 .. ? |
18673 | 39 "2" "(1Qi(B" "(1Vi(B" "(1O(B" "." "(1Si(B" "," ":" ; @ .. G |
40 "(1j(B" "(1N(B" "(1k(B" "!" "?" "(1f(B" "(1Wi(B" "(1|(B" ; H .. O | |
41 "(1](B" "(1[i(B" "_" ";" "+" "(1Ui(B" "x" "0" ; P .. W | |
19374
b4eb3242ba6e
(lao-keyboard-mapping): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents:
19261
diff
changeset
|
42 "\(" "(1Ti(B" "\"" "(1:(B" 0 "(1E(B" "(1\(B" "9" ; X .. _ |
18673 | 43 "(1'(B" "(1Q(B" "(1V(B" "(1a(B" "(1!(B" "(1S(B" "(14(B" "(1`(B" ; ` .. g |
44 "(1i(B" "(1C(B" "(1h(B" "(1R(B" "(1J(B" "(17(B" "(1W(B" "(19(B" ; h .. o | |
45 "(1-(B" "(1[(B" "(1>(B" "(1K(B" "(1P(B" "(1U(B" "(1M(B" "(1d(B" ; p .. w | |
46 "(1;(B" "(1T(B" "(1<(B" "-" "(1K\(B" "/" "~" 0] ; x .. DEL | |
47 "A table which maps ASCII key codes to corresponding Lao characters." | |
48 ) | |
49 | |
50 ) | |
51 | |
52 ;; Template of a cdr part of a Quail map when a consonant is entered. | |
53 (defvar lao-consonant-alist nil) | |
54 ;; Template of a cdr part of a Quail map when a vowel upper is entered. | |
55 (defvar lao-vowel-upper-alist nil) | |
56 ;; Template of a cdr part of a Quail map when a vowel lower is entered. | |
57 (defvar lao-vowel-lower-alist nil) | |
58 ;; Template of a cdr part of a Quail map when a semivowel lower is entered. | |
59 (defvar lao-semivowel-lower-alist nil) | |
60 | |
61 ;; Return a Quail map corresponding to KEY of length LEN. | |
62 ;; The car part of the map is a translation generated automatically. | |
63 ;; The cdr part of the map is a copy of ALIST. | |
64 (defun lao-generate-quail-map (key len alist) | |
65 (let ((str "") | |
66 (idx 0)) | |
67 (while (< idx len) | |
68 (setq str (concat str (aref lao-keyboard-mapping (aref key idx))) | |
69 idx (1+ idx))) | |
70 (cons (string-to-char (compose-string str)) (copy-alist alist)))) | |
71 | |
72 ;; Return a Quail map corresponding to KEY of length LEN when Lao | |
73 ;; tone mark is entered. | |
74 (defun lao-tone-input (key len) | |
75 (lao-generate-quail-map key len nil)) | |
76 | |
77 ;; Return a Quail map corresponding to KEY of length LEN when Lao | |
78 ;; vowel upper is entered. | |
79 (defun lao-vowel-upper-input (key len) | |
80 (lao-generate-quail-map key len lao-vowel-upper-alist)) | |
81 | |
82 ;; Return a Quail map corresponding to KEY of length LEN when Lao | |
83 ;; vowel lower is entered. | |
84 (defun lao-vowel-lower-input (key len) | |
85 (lao-generate-quail-map key len lao-vowel-lower-alist)) | |
86 | |
87 ;; Return a Quail map corresponding to KEY of length LEN when Lao | |
88 ;; semivowel lower is entered. | |
89 (defun lao-semivowel-lower-input (key len) | |
90 (lao-generate-quail-map key len lao-semivowel-lower-alist)) | |
91 | |
92 ;; Return an alist which can be a cdr part of a Quail map | |
93 ;; corresponding to the current key when Lao consonant is entered. | |
94 (defun lao-consonant-input (key len) | |
95 (copy-alist lao-consonant-alist)) | |
96 | |
97 (quail-define-package | |
19261
84a9af170661
Change title string of input method "Lao".
Kenichi Handa <handa@m17n.org>
parents:
18673
diff
changeset
|
98 "lao" "Lao" "(1E(B" t |
18673 | 99 "Lao input method simulating Lao keyboard layout based on Thai TIS620" |
19722
dd39cae4cf0f
For each package, pass t for the SIMPLE
Kenichi Handa <handa@m17n.org>
parents:
19374
diff
changeset
|
100 nil t t t t nil nil nil nil nil t) |
18673 | 101 |
102 (defmacro lao-quail-define-rules (&rest rules) | |
103 (let ((l rules) | |
104 consonant-alist | |
105 vowel-upper-alist | |
106 vowel-lower-alist | |
107 semivowel-lower-alist | |
108 rule trans ch c-set) | |
109 (while l | |
110 (setq rule (car l)) | |
111 (setq trans (nth 1 rule)) | |
112 (if (consp trans) | |
113 (setq trans (car trans))) | |
114 (setq c-set (char-category-set (string-to-char trans))) | |
115 (cond ((aref c-set ?2) ; vowel upper | |
116 (setq consonant-alist | |
117 (cons (cons (string-to-char (car rule)) | |
118 'lao-vowel-upper-input) | |
119 consonant-alist))) | |
120 ((aref c-set ?3) ; vowel lower | |
121 (setq consonant-alist | |
122 (cons (cons (string-to-char (car rule)) | |
123 'lao-vowel-lower-input) | |
124 consonant-alist) | |
125 semivowel-lower-alist | |
126 (cons (cons (string-to-char (car rule)) | |
127 'lao-vowel-lower-input) | |
128 semivowel-lower-alist))) | |
129 ((aref c-set ?4) ; tone | |
130 (setq consonant-alist | |
131 (cons (cons (string-to-char (car rule)) | |
132 'lao-tone-input) | |
133 consonant-alist) | |
134 vowel-upper-alist | |
135 (cons (cons (string-to-char (car rule)) | |
136 'lao-tone-input) | |
137 vowel-upper-alist) | |
138 vowel-lower-alist | |
139 (cons (cons (string-to-char (car rule)) | |
140 'lao-tone-input) | |
141 vowel-lower-alist))) | |
142 ((aref c-set ?9) ; semivowel lower | |
143 (setq consonant-alist | |
144 (cons (cons (string-to-char (car rule)) | |
145 'lao-semivowel-lower-input) | |
146 consonant-alist) | |
147 vowel-upper-alist | |
148 (cons (cons (string-to-char (car rule)) | |
149 'lao-semivowel-lower-input) | |
150 vowel-upper-alist)))) | |
151 (setq l (cdr l))) | |
152 (list 'progn | |
153 (cons 'quail-define-rules rules) | |
154 `(setq lao-consonant-alist ',consonant-alist | |
155 lao-vowel-upper-alist ',vowel-upper-alist | |
156 lao-vowel-lower-alist ',vowel-lower-alist | |
157 lao-semivowel-lower-alist ',semivowel-lower-alist)))) | |
158 | |
159 (lao-quail-define-rules | |
160 ("!" "1") | |
161 ("\"" "=") | |
162 ("#" "3") | |
163 ("$" "4") | |
164 ("&" "5") | |
165 ("%" "(1l(B") | |
166 ("'" ("(1'(B" . lao-consonant-input)) | |
167 ("(" "7") | |
168 (")" "8") | |
169 ("*" "6") | |
170 ("+" "0(1mh1(B") | |
171 ("," ("(1A(B" . lao-consonant-input)) | |
19374
b4eb3242ba6e
(lao-keyboard-mapping): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents:
19261
diff
changeset
|
172 ("-" ("(1*(B" . lao-consonant-input)) |
18673 | 173 ("." "(1c(B") |
174 ("/" ("(1=(B" . lao-consonant-input)) | |
175 ("0" ("(1"(B" . lao-consonant-input)) | |
176 ("1" ("(1B(B" . lao-consonant-input)) | |
177 ("2" ("(1?(B" . lao-consonant-input)) | |
178 ("3" "(1b(B") | |
179 ("4" ("(16(B" . lao-consonant-input)) | |
180 ("5" "(1X(B") | |
181 ("6" "(1Y(B") | |
182 ("7" ("(1$(B" . lao-consonant-input)) | |
183 ("8" ("(15(B" . lao-consonant-input)) | |
184 ("9" ("(1((B" . lao-consonant-input)) | |
185 (":" "%") | |
186 (";" ("(1G(B" . lao-consonant-input)) | |
187 ("<" ("(1}(B" . lao-consonant-input)) | |
188 ("=" "(1m(B") | |
19374
b4eb3242ba6e
(lao-keyboard-mapping): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents:
19261
diff
changeset
|
189 (">" "$") |
18673 | 190 ("?" ")") |
191 ("@" "2") | |
192 ("A" "0(1Qi1(B") | |
193 ("B" "0(1Vi1(B") | |
194 ("C" "(1O(B") | |
195 ("D" ".") | |
196 ("E" "0(1Si1(B") | |
197 ("F" ",") | |
198 ("G" ":") | |
199 ("H" "(1j(B") | |
200 ("I" ("(1N(B" . lao-consonant-input)) | |
201 ("J" "(1k(B") | |
202 ("K" "!") | |
203 ("L" "?") | |
204 ("M" "(1f(B") | |
205 ("N" "0(1Wi1(B") | |
206 ("O" ("(1|(B" . lao-consonant-input)) | |
207 ("P" "(1](B") | |
208 ("Q" "0(1[i1(B") | |
209 ("R" "_") | |
210 ("S" ";") | |
211 ("T" "+") | |
212 ("U" "0(1Ui1(B") | |
213 ("V" "x") | |
214 ("W" "0") | |
215 ("X" "(") | |
216 ("Y" "0(1Ti1(B") | |
217 ("Z" "\"") | |
218 ("[" ("(1:(B" . lao-consonant-input)) | |
219 ("]" ("(1E(B" . lao-consonant-input)) | |
220 ("^" "(1\(B") | |
19374
b4eb3242ba6e
(lao-keyboard-mapping): Some elements corrected.
Kenichi Handa <handa@m17n.org>
parents:
19261
diff
changeset
|
221 ("_" "9") |
18673 | 222 ("`" ("(1'(B" . lao-consonant-input)) |
223 ("a" "(1Q(B") | |
224 ("b" "(1V(B") | |
225 ("c" "(1a(B") | |
226 ("d" ("(1!(B" . lao-consonant-input)) | |
227 ("e" "(1S(B") | |
228 ("f" ("(14(B" . lao-consonant-input)) | |
229 ("g" "(1`(B") | |
230 ("h" "(1i(B") | |
231 ("i" ("(1C(B" . lao-consonant-input)) | |
232 ("j" "(1h(B") | |
233 ("k" "(1R(B") | |
234 ("l" ("(1J(B" . lao-consonant-input)) | |
235 ("m" ("(17(B" . lao-consonant-input)) | |
236 ("n" "(1W(B") | |
237 ("o" ("(19(B" . lao-consonant-input)) | |
238 ("p" ("(1-(B" . lao-consonant-input)) | |
239 ("q" "(1[(B") | |
240 ("r" ("(1>(B" . lao-consonant-input)) | |
241 ("s" ("(1K(B" . lao-consonant-input)) | |
242 ("t" "(1P(B") | |
243 ("u" "(1U(B") | |
244 ("v" ("(1M(B" . lao-consonant-input)) | |
245 ("w" "(1d(B") | |
246 ("x" ("(1;(B" . lao-consonant-input)) | |
247 ("y" "(1T(B") | |
248 ("z" ("(1<(B" . lao-consonant-input)) | |
249 ("{" "-") | |
250 ("|" ("0(1K\1(B" . lao-consonant-input)) | |
251 ("}" "/") | |
252 ("~" "(1l(B") | |
253 ("\\0" "(1p(B") | |
254 ("\\1" "(1q(B") | |
255 ("\\2" "(1r(B") | |
256 ("\\3" "(1s(B") | |
257 ("\\4" "(1t(B") | |
258 ("\\5" "(1u(B") | |
259 ("\\6" "(1v(B") | |
260 ("\\7" "(1w(B") | |
261 ("\\8" "(1x(B") | |
262 ("\\9" "(1y(B") | |
263 ) | |
264 | |
265 | |
266 ;;; quail/lao.el ends here |