/[emacs]/emacs/lisp/emacs-lisp/easymenu.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/easymenu.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.50 by monnier, Wed May 15 22:14:16 2002 UTC revision 1.51 by rms, Tue Jul 2 18:49:03 2002 UTC
# Line 616  In some cases we use that to select betw Line 616  In some cases we use that to select betw
616    (or (keymapp map) (error "Malformed menu in easy-menu: (%s)" map))    (or (keymapp map) (error "Malformed menu in easy-menu: (%s)" map))
617    map)    map)
618    
619    (defun easy-menu-popup-menu (menu &optional event)
620      "Pop up a menu and run a command according to user's selection.
621    MENU is a menu description as in `easy-menu-define'.
622    EVENT is a mouse button event and determines where to pop up the menu.
623    If EVENT is nil, pop up menu at the current mouse position."
624      (let ((map (easy-menu-create-menu (car menu) (cdr menu))))
625        (if (symbolp map)
626            (let ((f (memq :filter (get map 'menu-prop))))
627              (setq map (symbol-function map))
628              (if f (setq map (funcall (cadr f) map)))))
629        (let* ((sel (x-popup-menu (or event t) map))
630               (f (if (consp sel) (lookup-key map (apply 'vector sel)))))
631          (if (commandp f) (call-interactively f)))))
632    
633  (provide 'easymenu)  (provide 'easymenu)
634    
635  ;;; easymenu.el ends here  ;;; easymenu.el ends here

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26