]> code.delx.au - gnu-emacs/blobdiff - leim/quail/lao.el
* syntax.c (Fchar_syntax): Check the arg is a character.
[gnu-emacs] / leim / quail / lao.el
index 955420af55baf52891a440f40d572de0de78cb50..be756cb22297f254ef79760c1a8433f985b55b98 100644 (file)
@@ -1,16 +1,18 @@
-;;; quail/lao.el --- Quail package for inputting Lao characters
+;;; lao.el --- Quail package for inputting Lao characters  -*-coding: iso-2022-7bit;-*-
 
-;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
-;; Licensed to the Free Software Foundation.
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008, 2009, 2010
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: multilingual, input method, Lao
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,9 +20,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
 
 ;;; Code:
 
@@ -40,7 +42,7 @@
          (compose-string (quail-lookup-map-and-concat quail-current-key))))
   control-flag)
 
-(defconst lao-key-alist
+(defvar lao-key-alist
   '(("!" . "1")
     ("\"" . "=")
     ("#" . "3")
     ("\\7" . "\e(1w\e(B")
     ("\\8" . "\e(1x\e(B")
     ("\\9" . "\e(1y\e(B")
-    ))
-
-(defconst lao-consonant-key-alist nil)
-(defconst lao-semivowel-key-alist nil)
-(defconst lao-vowel-key-alist nil)
-(defconst lao-voweltone-key-alist nil)
-(defconst lao-tone-key-alist nil)
-(defconst lao-other-key-alist nil)
-
-(let ((tail lao-key-alist)
-      elt phonetic-type)
-  (while tail
-    (setq elt (car tail) tail (cdr tail))
-    (if (stringp (cdr elt))
-       (setq phonetic-type (get-char-code-property (aref (cdr elt) 0)
+    )
+  "Alist of key sequences vs the corresponding Lao string to input.
+This variable is for the input method \"lao\".
+If you change the value of this variable while quail/lao is already loaded,
+you need to re-load it to properly re-initialize related alists.")
+
+;; Temporary variable to initialize lao-consonant-key-alist, etc.
+(defconst lao-key-alist-vector
+  (let ((tail lao-key-alist)
+       consonant-key-alist semivowel-key-alist vowel-key-alist 
+       voweltone-key-alist tone-key-alist other-key-alist
+       elt phonetic-type)
+    (while tail
+      (setq elt (car tail) tail (cdr tail))
+      (if (stringp (cdr elt))
+         (setq phonetic-type (get-char-code-property (aref (cdr elt) 0)
+                                                     'phonetic-type))
+       (setq phonetic-type (get-char-code-property (aref (aref (cdr elt) 0) 0)
                                                    'phonetic-type))
-      (setq phonetic-type (get-char-code-property (aref (aref (cdr elt) 0) 0)
-                                                 'phonetic-type))
-      (aset (cdr elt) 0 (compose-string (aref (cdr elt) 0))))
-    (cond ((eq phonetic-type 'consonant)
-          (setq lao-consonant-key-alist (cons elt lao-consonant-key-alist)))
-         ((memq phonetic-type '(vowel-upper vowel-lower))
-          (if (stringp (cdr elt))
-              (setq lao-vowel-key-alist (cons elt lao-vowel-key-alist))
-            (setq lao-voweltone-key-alist
-                  (cons elt lao-voweltone-key-alist))))
-         ((eq  phonetic-type 'tone)
-          (setq lao-tone-key-alist (cons elt lao-tone-key-alist)))
-         ((eq phonetic-type 'semivowel-lower)
-          (setq lao-semivowel-key-alist (cons elt lao-semivowel-key-alist)))
-         (t
-          (setq lao-other-key-alist (cons elt lao-other-key-alist))))))
+       (aset (cdr elt) 0 (compose-string (aref (cdr elt) 0))))
+      (cond ((eq phonetic-type 'consonant)
+            (setq consonant-key-alist (cons elt consonant-key-alist)))
+           ((memq phonetic-type '(vowel-upper vowel-lower))
+            (if (stringp (cdr elt))
+                (setq vowel-key-alist (cons elt vowel-key-alist))
+              (setq voweltone-key-alist (cons elt voweltone-key-alist))))
+           ((eq  phonetic-type 'tone)
+            (setq tone-key-alist (cons elt tone-key-alist)))
+           ((eq phonetic-type 'semivowel-lower)
+            (setq semivowel-key-alist (cons elt semivowel-key-alist)))
+           (t
+            (setq other-key-alist (cons elt other-key-alist)))))
+    (vector consonant-key-alist semivowel-key-alist vowel-key-alist 
+           voweltone-key-alist tone-key-alist other-key-alist)))
+
+(defconst lao-consonant-key-alist (aref lao-key-alist-vector 0))
+(defconst lao-semivowel-key-alist (aref lao-key-alist-vector 1))
+(defconst lao-vowel-key-alist (aref lao-key-alist-vector 2))
+(defconst lao-voweltone-key-alist (aref lao-key-alist-vector 3))
+(defconst lao-tone-key-alist (aref lao-key-alist-vector 4))
+(defconst lao-other-key-alist (aref lao-key-alist-vector 5))
+
+;; Done with it.
+(makunbound 'lao-key-alist-vector)
 
 (quail-define-package
  "lao" "Lao" "\e(1E\e(B" t
                lao-tone-key-alist
                lao-other-key-alist)
     (svt-state (lao-semivowel-key-alist . v-state)
-             (lao-vowel-key-alist . t-state)
-             lao-voweltone-key-alist)
+              (lao-vowel-key-alist . t-state)
+              lao-voweltone-key-alist
+              lao-tone-key-alist)
     (v-state (lao-vowel-key-alist . t-state))
     (t-state lao-tone-key-alist))))
 
-;;; quail/lao.el ends here
+;; arch-tag: 23863a30-a8bf-402c-b7ce-c517a7aa8570
+;;; lao.el ends here