summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-05-22 07:09:32 +0000
committerRichard M. Stallman <rms@gnu.org>1994-05-22 07:09:32 +0000
commite025dddff15c376bd32bc16b38b928a96e1a19e9 (patch)
tree2057c11dbb938e385fc68d616b33598bebc2c63c /lisp/subr.el
parent8b4b171e74f291e65405d8ba0a85f262b76f4d34 (diff)
downloademacs-e025dddff15c376bd32bc16b38b928a96e1a19e9.tar.gz
(substitute-key-definition): Skip cached menu key-equivs.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 471d49a1ea9..b5b7a8d620d 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -168,15 +168,22 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
(while (stringp (car-safe defn))
(setq skipped (cons (car defn) skipped))
(setq defn (cdr defn)))
+ ;; Skip past cached key-equivalence data for menu items.
+ (and (consp defn) (consp (car defn))
+ (setq defn (cdr defn)))
(setq inner-def defn)
+ ;; Look past a symbol that names a keymap.
(while (and (symbolp inner-def)
(fboundp inner-def))
(setq inner-def (symbol-function inner-def)))
(if (eq defn olddef)
(define-key keymap prefix1 (nconc (nreverse skipped) newdef))
+ ;; Avoid recursively rescanning a keymap being scanned.
(if (and (keymapp defn)
(not (memq inner-def
key-substitution-in-progress)))
+ ;; If this one isn't being scanned already,
+ ;; scan it now.
(substitute-key-definition olddef newdef keymap
inner-def
prefix1)))))
@@ -195,6 +202,8 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
(while (stringp (car-safe defn))
(setq skipped (cons (car defn) skipped))
(setq defn (cdr defn)))
+ (and (consp defn) (consp (car defn))
+ (setq defn (cdr defn)))
(setq inner-def defn)
(while (and (symbolp inner-def)
(fboundp inner-def))