From: Kenichi Handa Date: Wed, 26 Feb 1997 13:03:20 +0000 (+0000) Subject: Add quail-mode to default value of X-Git-Tag: emacs-20.1~2850 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5350ad1dda5764b75ee962dd1b57a7dfa9988385;p=emacs.git 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. --- diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 4beabf301ea..d10538375a3 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -232,6 +232,14 @@ LEIM is available from the same ftp directory as Emacs.")) (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 @@ key binding (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))