From 328a37ec312c1eadedae8210b9554d2e51353981 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 22 Mar 1997 03:55:21 +0000 Subject: [PATCH] (substitute-key-definition): Compare with equal if definition is a key sequence. --- lisp/subr.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 3f215b1970d..a498cea5b37 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -125,7 +125,11 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP." (while (and (symbolp inner-def) (fboundp inner-def)) (setq inner-def (symbol-function inner-def))) - (if (eq defn olddef) + (if (or (eq defn olddef) + ;; Compare with equal if definition is a key sequence. + ;; That is useful for operating on function-key-map. + (and (or (stringp defn) (vectorp defn)) + (equal defn olddef))) (define-key keymap prefix1 (nconc (nreverse skipped) newdef)) (if (and (keymapp defn) ;; Avoid recursively scanning @@ -162,7 +166,9 @@ in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP." (while (and (symbolp inner-def) (fboundp inner-def)) (setq inner-def (symbol-function inner-def))) - (if (eq defn olddef) + (if (or (eq defn olddef) + (and (or (stringp defn) (vectorp defn)) + (equal defn olddef))) (define-key keymap prefix1 (nconc (nreverse skipped) newdef)) (if (and (keymapp defn) -- 2.39.2