changeset 6005:bf1c9fd5669b

(substitute-key-definition): Don't discard menu strings.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Feb 1994 00:01:46 +0000
parents 4fa3d631dae8
children dc6d45202fb9
files lisp/subr.el
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Fri Feb 18 23:51:41 1994 +0000
+++ b/lisp/subr.el	Sat Feb 19 00:01:46 1994 +0000
@@ -152,16 +152,17 @@
 	    ;; 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 @@
 		  ;; 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