aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2004-12-04 02:49:34 +0000
committerKenichi Handa2004-12-04 02:49:34 +0000
commita3341d3c44c9dd4f8cfe2a6f3236f7f77cfd7842 (patch)
tree4bc2110f60365896b204b1f98f26b705c78fcfe8
parent6108209e54dd665180515131e484fb3870ea6ab1 (diff)
downloademacs-a3341d3c44c9dd4f8cfe2a6f3236f7f77cfd7842.tar.gz
emacs-a3341d3c44c9dd4f8cfe2a6f3236f7f77cfd7842.zip
(lao-key-alist): Declare it by defvar.
(lao-key-alist-vector): New variable. (lao-consonant-key-alist, lao-semivowel-key-alist) (lao-vowel-key-alist, lao-voweltone-key-alist) (lao-tone-key-alist, lao-other-key-alist): Initialize them from lao-key-alist-vector.
-rw-r--r--leim/ChangeLog9
-rw-r--r--leim/quail/lao.el79
2 files changed, 56 insertions, 32 deletions
diff --git a/leim/ChangeLog b/leim/ChangeLog
index 7bff23067d6..df9923f6a29 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,12 @@
12004-12-04 Kenichi Handa <handa@m17n.org>
2
3 * quail/lao.el (lao-key-alist): Declare it by defvar.
4 (lao-key-alist-vector): New variable.
5 (lao-consonant-key-alist, lao-semivowel-key-alist)
6 (lao-vowel-key-alist, lao-voweltone-key-alist)
7 (lao-tone-key-alist, lao-other-key-alist): Initialize them from
8 lao-key-alist-vector.
9
12004-09-25 Kenichi Handa <handa@m17n.org> 102004-09-25 Kenichi Handa <handa@m17n.org>
2 11
3 * quail/uni-input.el (ucs-input-method): Add error clause to 12 * quail/uni-input.el (ucs-input-method): Add error clause to
diff --git a/leim/quail/lao.el b/leim/quail/lao.el
index 003cbb43be1..c5f66bba813 100644
--- a/leim/quail/lao.el
+++ b/leim/quail/lao.el
@@ -2,6 +2,9 @@
2 2
3;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. 3;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
4;; Licensed to the Free Software Foundation. 4;; Licensed to the Free Software Foundation.
5;; Copyright (C) 2004
6;; National Institute of Advanced Industrial Science and Technology (AIST)
7;; Registration Number H14PRO021
5 8
6;; Keywords: multilingual, input method, Lao 9;; Keywords: multilingual, input method, Lao
7 10
@@ -42,7 +45,7 @@
42 (compose-string (quail-lookup-map-and-concat quail-current-key)))) 45 (compose-string (quail-lookup-map-and-concat quail-current-key))))
43 control-flag) 46 control-flag)
44 47
45(defconst lao-key-alist 48(defvar lao-key-alist
46 '(("!" . "1") 49 '(("!" . "1")
47 ("\"" . "=") 50 ("\"" . "=")
48 ("#" . "3") 51 ("#" . "3")
@@ -146,38 +149,50 @@
146 ("\\7" . "(1w(B") 149 ("\\7" . "(1w(B")
147 ("\\8" . "(1x(B") 150 ("\\8" . "(1x(B")
148 ("\\9" . "(1y(B") 151 ("\\9" . "(1y(B")
149 )) 152 )
150 153 "Alist of key sequences vs the corresponding Lao string to input.
151(defconst lao-consonant-key-alist nil) 154This variable is for the input method \"lao\".
152(defconst lao-semivowel-key-alist nil) 155If you change the value of this variable while quail/lao is already loaded,
153(defconst lao-vowel-key-alist nil) 156you need to re-load it to properly re-initialize related alists.")
154(defconst lao-voweltone-key-alist nil) 157
155(defconst lao-tone-key-alist nil) 158;; Temporary variable to initialize lao-consonant-key-alist, etc.
156(defconst lao-other-key-alist nil) 159(defconst lao-key-alist-vector
157 160 (let ((tail lao-key-alist)
158(let ((tail lao-key-alist) 161 consonant-key-alist semivowel-key-alist vowel-key-alist
159 elt phonetic-type) 162 voweltone-key-alist tone-key-alist other-key-alist
160 (while tail 163 elt phonetic-type)
161 (setq elt (car tail) tail (cdr tail)) 164 (while tail
162 (if (stringp (cdr elt)) 165 (setq elt (car tail) tail (cdr tail))
163 (setq phonetic-type (get-char-code-property (aref (cdr elt) 0) 166 (if (stringp (cdr elt))
167 (setq phonetic-type (get-char-code-property (aref (cdr elt) 0)
168 'phonetic-type))
169 (setq phonetic-type (get-char-code-property (aref (aref (cdr elt) 0) 0)
164 'phonetic-type)) 170 'phonetic-type))
165 (setq phonetic-type (get-char-code-property (aref (aref (cdr elt) 0) 0) 171 (aset (cdr elt) 0 (compose-string (aref (cdr elt) 0))))
166 'phonetic-type)) 172 (cond ((eq phonetic-type 'consonant)
167 (aset (cdr elt) 0 (compose-string (aref (cdr elt) 0)))) 173 (setq consonant-key-alist (cons elt consonant-key-alist)))
168 (cond ((eq phonetic-type 'consonant) 174 ((memq phonetic-type '(vowel-upper vowel-lower))
169 (setq lao-consonant-key-alist (cons elt lao-consonant-key-alist))) 175 (if (stringp (cdr elt))
170 ((memq phonetic-type '(vowel-upper vowel-lower)) 176 (setq vowel-key-alist (cons elt vowel-key-alist))
171 (if (stringp (cdr elt)) 177 (setq voweltone-key-alist (cons elt voweltone-key-alist))))
172 (setq lao-vowel-key-alist (cons elt lao-vowel-key-alist)) 178 ((eq phonetic-type 'tone)
173 (setq lao-voweltone-key-alist 179 (setq tone-key-alist (cons elt tone-key-alist)))
174 (cons elt lao-voweltone-key-alist)))) 180 ((eq phonetic-type 'semivowel-lower)
175 ((eq phonetic-type 'tone) 181 (setq semivowel-key-alist (cons elt semivowel-key-alist)))
176 (setq lao-tone-key-alist (cons elt lao-tone-key-alist))) 182 (t
177 ((eq phonetic-type 'semivowel-lower) 183 (setq other-key-alist (cons elt other-key-alist)))))
178 (setq lao-semivowel-key-alist (cons elt lao-semivowel-key-alist))) 184 (vector consonant-key-alist semivowel-key-alist vowel-key-alist
179 (t 185 voweltone-key-alist tone-key-alist other-key-alist)))
180 (setq lao-other-key-alist (cons elt lao-other-key-alist)))))) 186
187(defconst lao-consonant-key-alist (aref lao-key-alist-vector 0))
188(defconst lao-semivowel-key-alist (aref lao-key-alist-vector 1))
189(defconst lao-vowel-key-alist (aref lao-key-alist-vector 2))
190(defconst lao-voweltone-key-alist (aref lao-key-alist-vector 3))
191(defconst lao-tone-key-alist (aref lao-key-alist-vector 4))
192(defconst lao-other-key-alist (aref lao-key-alist-vector 5))
193
194;; Done with it.
195(makunbound 'lao-key-alist-vector)
181 196
182(quail-define-package 197(quail-define-package
183 "lao" "Lao" "(1E(B" t 198 "lao" "Lao" "(1E(B" t