1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

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

This commit is contained in:
Richard M. Stallman 1994-02-19 00:01:46 +00:00
parent 2eb9adabed
commit 44d798af46

View File

@ -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