changeset 90665:38ad9fa1876b

(quail-insert-kbd-layout): Check the length of (cdr translation). (quail-get-current-str): Check the length of (cdr def).
author Kenichi Handa <handa@m17n.org>
date Tue, 21 Nov 2006 01:10:33 +0000
parents aa6d1499ee0a
children 00d54c8fa693
files lisp/international/quail.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Mon Nov 20 12:10:54 2006 +0000
+++ b/lisp/international/quail.el	Tue Nov 21 01:10:33 2006 +0000
@@ -798,7 +798,9 @@
 	(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 @@
   "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