]> git.eshelyaron.com Git - emacs.git/commitdiff
(substitute-key-definition):
authorRichard M. Stallman <rms@gnu.org>
Sat, 22 Mar 1997 03:55:21 +0000 (03:55 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 22 Mar 1997 03:55:21 +0000 (03:55 +0000)
Compare with equal if definition is a key sequence.

lisp/subr.el

index 3f215b1970d099d758532ccf36e91e52e49845e4..a498cea5b37f3b35c959923a6607ab5ac93ed772 100644 (file)
@@ -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)