From 6b829ee1e3124d4508d9dfb8bd2183243fc909eb Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 21 Nov 2006 01:10:33 +0000 Subject: [PATCH] (quail-insert-kbd-layout): Check the length of (cdr translation). (quail-get-current-str): Check the length of (cdr def). --- lisp/international/quail.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 75de3e1f271..17dd5013805 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -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 -- 2.39.5