changeset 30207:584fa6f665f1

(easy-menu-convert-item-1): Intern the label.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 14 Jul 2000 08:37:28 +0000
parents 0f93b32d6add
children e0e295d641ba
files lisp/emacs-lisp/easymenu.el
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/easymenu.el	Fri Jul 14 02:08:34 2000 +0000
+++ b/lisp/emacs-lisp/easymenu.el	Fri Jul 14 08:37:28 2000 +0000
@@ -351,11 +351,15 @@
 		 (or (null cache) (stringp cache) (vectorp cache)))
 	    (setq prop (cons :key-sequence (cons cache prop))))))
      (t (error "Invalid menu item in easymenu")))
-    (cons name (and (not remove)
-		    (cons 'menu-item
-			  (cons label
-				(and name
-				     (cons command prop))))))))
+    ;; `intern' the name so as to merge multiple entries with the same name.
+    ;; It also makes it easier/possible to lookup/change menu bindings
+    ;; via keymap functions.
+    (cons (intern name)
+	  (and (not remove)
+	       (cons 'menu-item
+		     (cons label
+			   (and name
+				(cons command prop))))))))
 
 (defun easy-menu-define-key-intern (menu key item &optional before)
   "Like easy-menu-define-key, but interns KEY and BEFORE if they are strings."