comparison lisp/emacs-lisp/easymenu.el @ 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 00cce196e38b
children f59674c820d9
comparison
equal deleted inserted replaced
30206:0f93b32d6add 30207:584fa6f665f1
349 (setq prop (cons :enable (cons active prop)))) 349 (setq prop (cons :enable (cons active prop))))
350 (if (and (or no-name cache-specified) 350 (if (and (or no-name cache-specified)
351 (or (null cache) (stringp cache) (vectorp cache))) 351 (or (null cache) (stringp cache) (vectorp cache)))
352 (setq prop (cons :key-sequence (cons cache prop)))))) 352 (setq prop (cons :key-sequence (cons cache prop))))))
353 (t (error "Invalid menu item in easymenu"))) 353 (t (error "Invalid menu item in easymenu")))
354 (cons name (and (not remove) 354 ;; `intern' the name so as to merge multiple entries with the same name.
355 (cons 'menu-item 355 ;; It also makes it easier/possible to lookup/change menu bindings
356 (cons label 356 ;; via keymap functions.
357 (and name 357 (cons (intern name)
358 (cons command prop)))))))) 358 (and (not remove)
359 (cons 'menu-item
360 (cons label
361 (and name
362 (cons command prop))))))))
359 363
360 (defun easy-menu-define-key-intern (menu key item &optional before) 364 (defun easy-menu-define-key-intern (menu key item &optional before)
361 "Like easy-menu-define-key, but interns KEY and BEFORE if they are strings." 365 "Like easy-menu-define-key, but interns KEY and BEFORE if they are strings."
362 (easy-menu-define-key menu (if (stringp key) (intern key) key) item 366 (easy-menu-define-key menu (if (stringp key) (intern key) key) item
363 (if (stringp before) (intern before) before))) 367 (if (stringp before) (intern before) before)))