1 ;;; quail/lao.el --- Quail package for inputting Lao characters
3 ;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
6 ;; Keywords: multilingual, input method, Lao
8 ;; This file is part of GNU Emacs.
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)
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.
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.
30 (defun quail-lao-update-translation (control-flag)
31 (if (integerp control-flag
)
32 ;; Non-composable character typed.
33 (setq quail-current-str
34 (buffer-substring (overlay-start quail-overlay
)
35 (overlay-end quail-overlay
))
38 (substring quail-current-key control-flag
)))
39 (setq quail-current-str
40 (compose-string (quail-lookup-map-and-concat quail-current-key
))))
43 (defconst lao-key-alist
54 ("+" .
["\e(1mh\e(B"])
76 ("A" .
["\e(1Qi\e(B"])
77 ("B" .
["\e(1Vi\e(B"])
80 ("E" .
["\e(1Si\e(B"])
89 ("N" .
["\e(1Wi\e(B"])
92 ("Q" .
["\e(1[i\e(B"])
96 ("U" .
["\e(1Ui\e(B"])
100 ("Y" .
["\e(1Ti\e(B"])
134 ("|" .
["\e(1K\\e(B"])
137 ("\\0" .
"\e(1p\e(B")
138 ("\\1" .
"\e(1q\e(B")
139 ("\\2" .
"\e(1r\e(B")
140 ("\\3" .
"\e(1s\e(B")
141 ("\\4" .
"\e(1t\e(B")
142 ("\\5" .
"\e(1u\e(B")
143 ("\\6" .
"\e(1v\e(B")
144 ("\\7" .
"\e(1w\e(B")
145 ("\\8" .
"\e(1x\e(B")
146 ("\\9" .
"\e(1y\e(B")
149 (defconst lao-consonant-key-alist nil
)
150 (defconst lao-semivowel-key-alist nil
)
151 (defconst lao-vowel-key-alist nil
)
152 (defconst lao-voweltone-key-alist nil
)
153 (defconst lao-tone-key-alist nil
)
154 (defconst lao-other-key-alist nil
)
156 (let ((tail lao-key-alist
)
159 (setq elt
(car tail
) tail
(cdr tail
))
160 (if (stringp (cdr elt
))
161 (setq phonetic-type
(get-char-code-property (aref (cdr elt
) 0)
163 (setq phonetic-type
(get-char-code-property (aref (aref (cdr elt
) 0) 0)
165 (aset (cdr elt
) 0 (compose-string (aref (cdr elt
) 0))))
166 (cond ((eq phonetic-type
'consonant
)
167 (setq lao-consonant-key-alist
(cons elt lao-consonant-key-alist
)))
168 ((memq phonetic-type
'(vowel-upper vowel-lower
))
169 (if (stringp (cdr elt
))
170 (setq lao-vowel-key-alist
(cons elt lao-vowel-key-alist
))
171 (setq lao-voweltone-key-alist
172 (cons elt lao-voweltone-key-alist
))))
173 ((eq phonetic-type
'tone
)
174 (setq lao-tone-key-alist
(cons elt lao-tone-key-alist
)))
175 ((eq phonetic-type
'semivowel-lower
)
176 (setq lao-semivowel-key-alist
(cons elt lao-semivowel-key-alist
)))
178 (setq lao-other-key-alist
(cons elt lao-other-key-alist
))))))
180 (quail-define-package
181 "lao" "Lao" "\e(1E\e(B" t
182 "Lao input method simulating Lao keyboard layout based on Thai TIS620"
183 nil t t t t nil nil nil
'quail-lao-update-translation nil t
)
186 (quail-map-from-table
187 '((base-state (lao-consonant-key-alist . svt-state
)
189 lao-voweltone-key-alist
192 (svt-state (lao-semivowel-key-alist . v-state
)
193 (lao-vowel-key-alist . t-state
)
194 lao-voweltone-key-alist
)
195 (v-state (lao-vowel-key-alist . t-state
))
196 (t-state lao-tone-key-alist
))))
198 ;;; quail/lao.el ends here