Commit 44d798af authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(substitute-key-definition): Don't discard menu strings.

parent 2eb9adab
......@@ -152,16 +152,17 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
;; the inside of the following let that handles array elements.
(aset vec1 0 char)
(aset prefix1 (length prefix) char)
(let (inner-def)
(let (inner-def skipped)
;; Skip past menu-prompt.
(while (stringp (car-safe defn))
(setq skipped (cons (car defn) skipped))
(setq defn (cdr defn)))
(setq inner-def defn)
(while (and (symbolp inner-def)
(fboundp inner-def))
(setq inner-def (symbol-function inner-def)))
(if (eq defn olddef)
(define-key keymap prefix1 newdef)
(define-key keymap prefix1 (nconc (nreverse skipped) newdef))
(if (keymapp defn)
(substitute-key-definition olddef newdef keymap
inner-def
......@@ -176,16 +177,18 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
;; the inside of the previous let.
(aset vec1 0 char)
(aset prefix1 (length prefix) char)
(let (inner-def)
(let (inner-def skipped)
;; Skip past menu-prompt.
(while (stringp (car-safe defn))
(setq skipped (cons (car defn) skipped))
(setq defn (cdr defn)))
(setq inner-def defn)
(while (and (symbolp inner-def)
(fboundp inner-def))
(setq inner-def (symbol-function inner-def)))
(if (eq defn olddef)
(define-key keymap prefix1 newdef)
(define-key keymap prefix1
(nconc (nreverse skipped) newdef))
(if (keymapp defn)
(substitute-key-definition olddef newdef keymap
inner-def
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment