aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-22 07:09:32 +0000
committerRichard M. Stallman1994-05-22 07:09:32 +0000
commite025dddff15c376bd32bc16b38b928a96e1a19e9 (patch)
tree2057c11dbb938e385fc68d616b33598bebc2c63c /lisp
parent8b4b171e74f291e65405d8ba0a85f262b76f4d34 (diff)
downloademacs-e025dddff15c376bd32bc16b38b928a96e1a19e9.tar.gz
emacs-e025dddff15c376bd32bc16b38b928a96e1a19e9.zip
(substitute-key-definition): Skip cached menu key-equivs.
Diffstat (limited to 'lisp')
-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."
168 (while (stringp (car-safe defn)) 168 (while (stringp (car-safe defn))
169 (setq skipped (cons (car defn) skipped)) 169 (setq skipped (cons (car defn) skipped))
170 (setq defn (cdr defn))) 170 (setq defn (cdr defn)))
171 ;; Skip past cached key-equivalence data for menu items.
172 (and (consp defn) (consp (car defn))
173 (setq defn (cdr defn)))
171 (setq inner-def defn) 174 (setq inner-def defn)
175 ;; Look past a symbol that names a keymap.
172 (while (and (symbolp inner-def) 176 (while (and (symbolp inner-def)
173 (fboundp inner-def)) 177 (fboundp inner-def))
174 (setq inner-def (symbol-function inner-def))) 178 (setq inner-def (symbol-function inner-def)))
175 (if (eq defn olddef) 179 (if (eq defn olddef)
176 (define-key keymap prefix1 (nconc (nreverse skipped) newdef)) 180 (define-key keymap prefix1 (nconc (nreverse skipped) newdef))
181 ;; Avoid recursively rescanning a keymap being scanned.
177 (if (and (keymapp defn) 182 (if (and (keymapp defn)
178 (not (memq inner-def 183 (not (memq inner-def
179 key-substitution-in-progress))) 184 key-substitution-in-progress)))
185 ;; If this one isn't being scanned already,
186 ;; scan it now.
180 (substitute-key-definition olddef newdef keymap 187 (substitute-key-definition olddef newdef keymap
181 inner-def 188 inner-def
182 prefix1))))) 189 prefix1)))))
@@ -195,6 +202,8 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
195 (while (stringp (car-safe defn)) 202 (while (stringp (car-safe defn))
196 (setq skipped (cons (car defn) skipped)) 203 (setq skipped (cons (car defn) skipped))
197 (setq defn (cdr defn))) 204 (setq defn (cdr defn)))
205 (and (consp defn) (consp (car defn))
206 (setq defn (cdr defn)))
198 (setq inner-def defn) 207 (setq inner-def defn)
199 (while (and (symbolp inner-def) 208 (while (and (symbolp inner-def)
200 (fboundp inner-def)) 209 (fboundp inner-def))