1 ;;; 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.
32 (defun quail-lao-update-translation (control-flag)
33 (if (integerp control-flag)
34 ;; Non-composable character typed.
35 (setq quail-current-str
36 (buffer-substring (overlay-start quail-overlay)
37 (overlay-end quail-overlay))
40 (substring quail-current-key control-flag)))
41 (setq quail-current-str
42 (compose-string (quail-lookup-map-and-concat quail-current-key))))
45 (defconst lao-key-alist
56 ("+" . ["
\e(1mh
\e(B"])
78 ("A" . ["
\e(1Qi
\e(B"])
79 ("B" . ["
\e(1Vi
\e(B"])
82 ("E" . ["
\e(1Si
\e(B"])
91 ("N" . ["
\e(1Wi
\e(B"])
94 ("Q" . ["
\e(1[i
\e(B"])
98 ("U" . ["
\e(1Ui
\e(B"])
102 ("Y" . ["
\e(1Ti
\e(B"])
136 ("|" . ["
\e(1K\
\e(B"])
139 ("\\0" . "
\e(1p
\e(B")
140 ("\\1" . "
\e(1q
\e(B")
141 ("\\2" . "
\e(1r
\e(B")
142 ("\\3" . "
\e(1s
\e(B")
143 ("\\4" . "
\e(1t
\e(B")
144 ("\\5" . "
\e(1u
\e(B")
145 ("\\6" . "
\e(1v
\e(B")
146 ("\\7" . "
\e(1w
\e(B")
147 ("\\8" . "
\e(1x
\e(B")
148 ("\\9" . "
\e(1y
\e(B")
151 (defconst lao-consonant-key-alist nil)
152 (defconst lao-semivowel-key-alist nil)
153 (defconst lao-vowel-key-alist nil)
154 (defconst lao-voweltone-key-alist nil)
155 (defconst lao-tone-key-alist nil)
156 (defconst lao-other-key-alist nil)
158 (let ((tail lao-key-alist)
161 (setq elt (car tail) tail (cdr tail))
162 (if (stringp (cdr elt))
163 (setq phonetic-type (get-char-code-property (aref (cdr elt) 0)
165 (setq phonetic-type (get-char-code-property (aref (aref (cdr elt) 0) 0)
167 (aset (cdr elt) 0 (compose-string (aref (cdr elt) 0))))
168 (cond ((eq phonetic-type 'consonant)
169 (setq lao-consonant-key-alist (cons elt lao-consonant-key-alist)))
170 ((memq phonetic-type '(vowel-upper vowel-lower))
171 (if (stringp (cdr elt))
172 (setq lao-vowel-key-alist (cons elt lao-vowel-key-alist))
173 (setq lao-voweltone-key-alist
174 (cons elt lao-voweltone-key-alist))))
175 ((eq phonetic-type 'tone)
176 (setq lao-tone-key-alist (cons elt lao-tone-key-alist)))
177 ((eq phonetic-type 'semivowel-lower)
178 (setq lao-semivowel-key-alist (cons elt lao-semivowel-key-alist)))
180 (setq lao-other-key-alist (cons elt lao-other-key-alist))))))
182 (quail-define-package
183 "lao" "Lao" "
\e(1E
\e(B" t
184 "Lao input method simulating Lao keyboard layout based on Thai TIS620"
185 nil t t t t nil nil nil 'quail-lao-update-translation nil t)
188 (quail-map-from-table
189 '((base-state (lao-consonant-key-alist . svt-state)
191 lao-voweltone-key-alist
194 (svt-state (lao-semivowel-key-alist . v-state)
195 (lao-vowel-key-alist . t-state)
196 lao-voweltone-key-alist)
197 (v-state (lao-vowel-key-alist . t-state))
198 (t-state lao-tone-key-alist))))