changeset 17095:b57415dcc114

Add quail-mode to default value of minor-mode-map-alist if it is set to local variable. (quail-show-kbd-layout): Bug fixed for keys not translated.
author Kenichi Handa <handa@m17n.org>
date Wed, 26 Feb 1997 13:03:20 +0000
parents c237252970e5
children 4a2d9b3990e3
files lisp/international/quail.el
diffstat 1 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Wed Feb 26 13:01:42 1997 +0000
+++ b/lisp/international/quail.el	Wed Feb 26 13:03:20 1997 +0000
@@ -232,6 +232,14 @@
     (setq minor-mode-map-alist
 	  (cons (cons 'quail-mode quail-mode-map) minor-mode-map-alist)))
 
+;; Since some Emacs Lisp programs (e.g. viper.el) make
+;; minor-mode-map-alist buffer-local, we must be sure to register
+;; quail-mode-map in default-value of minor-mode-map-alist.
+(if (local-variable-p 'minor-mode-map-alist)
+    (let ((map (default-value 'minor-mode-map-alist)))
+      (or (assq 'quail-mode map)
+	  (set-default 'minor-mode-map-alist (cons 'quail-mode map)))))
+
 (defvar quail-translation-keymap
   (let ((map (make-keymap))
 	(i 0))
@@ -1462,14 +1470,14 @@
       (setq ch (aref quail-keyboard-layout i))
       (if (= ch ?\ )
 	  (insert ch)
-	(let ((map (cdr (assq ch (cdr (quail-map))))))
-	  (if map
-	      (let ((translation
-		     (quail-get-translation map (char-to-string ch) 1)))
-		(if (integerp translation)
-		    (insert translation)
-		  (insert (aref (cdr translation) (car translation)))))
-	    (insert ch))))
+	(let* ((map (cdr (assq ch (cdr (quail-map)))))
+	       (translation (and map (quail-get-translation 
+				      map (char-to-string ch) 1))))
+	  (if (integerp translation)
+	      (insert translation)
+	    (if (consp translation)
+		(insert (aref (cdr translation) (car translation)))
+	      (insert ch)))))
       (setq i (1+ i))))
   (newline))