summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-09-18 14:45:44 +0000
committerRichard M. Stallman <rms@gnu.org>1995-09-18 14:45:44 +0000
commit3c0b8167236aff26ba8f3c9269c9b1af04a5743c (patch)
treec630ef4d17e90dd4487f0b16f2b5ef4b836ff258 /lisp/subr.el
parentb4a6a5caeac12012ef66ad003696df4de265d97a (diff)
downloademacs-3c0b8167236aff26ba8f3c9269c9b1af04a5743c.tar.gz
(substitute-key-definition): Do recursively scan
where KEYMAP has nothing at all.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 970ba2ee4f6..fdf189c6851 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -129,7 +129,9 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
(if (and (keymapp defn)
;; Avoid recursively scanning
;; where KEYMAP does not have a submap.
- (keymapp (lookup-key keymap prefix1))
+ (let ((elt (lookup-key keymap prefix1)))
+ (or (null elt)
+ (keymapp elt)))
;; Avoid recursively rescanning keymap being scanned.
(not (memq inner-def
key-substitution-in-progress)))
@@ -163,7 +165,9 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
(define-key keymap prefix1
(nconc (nreverse skipped) newdef))
(if (and (keymapp defn)
- (keymapp (lookup-key keymap prefix1))
+ (let ((elt (lookup-key keymap prefix1)))
+ (or (null elt)
+ (keymapp elt)))
(not (memq inner-def
key-substitution-in-progress)))
(substitute-key-definition olddef newdef keymap