changeset 17215:21e3f467224e

(substitute-key-definition): Compare with equal if definition is a key sequence.
author Richard M. Stallman <rms@gnu.org>
date Sat, 22 Mar 1997 03:55:21 +0000
parents 15e868121a15
children ef3033d89075
files lisp/subr.el
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sat Mar 22 03:54:14 1997 +0000
+++ b/lisp/subr.el	Sat Mar 22 03:55:21 1997 +0000
@@ -125,7 +125,11 @@
 	      (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 @@
 		    (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)