/[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.51 by rms, Tue Jul 2 18:49:03 2002 UTC revision 1.52 by rms, Sun Jul 7 09:56:08 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    
 (defun easy-menu-popup-menu (menu &optional event)  
   "Pop up a menu and run a command according to user's selection.  
 MENU is a menu description as in `easy-menu-define'.  
 EVENT is a mouse button event and determines where to pop up the menu.  
 If EVENT is nil, pop up menu at the current mouse position."  
   (let ((map (easy-menu-create-menu (car menu) (cdr menu))))  
     (if (symbolp map)  
         (let ((f (memq :filter (get map 'menu-prop))))  
           (setq map (symbol-function map))  
           (if f (setq map (funcall (cadr f) map)))))  
     (let* ((sel (x-popup-menu (or event t) map))  
            (f (if (consp sel) (lookup-key map (apply 'vector sel)))))  
       (if (commandp f) (call-interactively f)))))  
   
619  (provide 'easymenu)  (provide 'easymenu)
620    
621  ;;; easymenu.el ends here  ;;; easymenu.el ends here

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

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