]> git.eshelyaron.com Git - emacs.git/commitdiff
(quail-insert-kbd-layout): Check the
authorKenichi Handa <handa@m17n.org>
Tue, 21 Nov 2006 01:10:33 +0000 (01:10 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 21 Nov 2006 01:10:33 +0000 (01:10 +0000)
length of (cdr translation).
(quail-get-current-str): Check the length of (cdr def).

lisp/international/quail.el

index 75de3e1f271627835c933d6ddf9e3a65fb4b8bfd..17dd50138056e282af9d6febc803a793ebf578a1 100644 (file)
@@ -798,7 +798,9 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
        (if translation
            (progn
              (if (consp translation)
-                 (setq translation (aref (cdr translation) 0)))
+                 (if (> (length (cdr translation)) 0)
+                     (setq translation (aref (cdr translation) 0))
+                   (setq translation " ")))
              (setq done-list (cons translation done-list)))
          (setq translation ch))
        (aset layout i translation))
@@ -1583,7 +1585,10 @@ with more keys."
   "Return string to be shown as current translation of key sequence.
 LEN is the length of the sequence.  DEF is a definition part of the
 Quail map for the sequence."
-  (or (and (consp def) (aref (cdr def) (car (car def))))
+  (or (and (consp def)
+          (if (> (length (cdr def)) (car (car def)))
+              (aref (cdr def) (car (car def)))
+            ""))
       def
       (and (> len 1)
           (let* ((str (quail-get-current-str