aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-09-26 15:34:39 +0000
committerDave Love2000-09-26 15:34:39 +0000
commitb52a30d869ea7a42fe8b474beaaedbeb490663e8 (patch)
tree4f02cf852d88118cc7e2e9311705825eb5e60ed3
parent876512abbb324aa297922ee68724a0938157a742 (diff)
downloademacs-b52a30d869ea7a42fe8b474beaaedbeb490663e8.tar.gz
emacs-b52a30d869ea7a42fe8b474beaaedbeb490663e8.zip
(popup-menu): If POSITION is nil, set it using
mouse-position.
-rw-r--r--lisp/mouse.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 373d1014a05..d612a2017ec 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -59,12 +59,15 @@ PREFIX is the prefix argument (if any) to pass to the command."
59 (plist-get (get map 'menu-pro) :filter)))) 59 (plist-get (get map 'menu-pro) :filter))))
60 (if filter (funcall filter (symbol-function map)) map))))) 60 (if filter (funcall filter (symbol-function map)) map)))))
61 event) 61 event)
62 (unless position
63 (let ((mp (mouse-position)))
64 (setq position (list (list (cadr mp) (cddr mp)) (car mp)))))
62 ;; The looping behavior was taken from lmenu's popup-menu-popup 65 ;; The looping behavior was taken from lmenu's popup-menu-popup
63 (while (and map (setq event 66 (while (and map (setq event
64 ;; map could be a prefix key, in which case 67 ;; map could be a prefix key, in which case
65 ;; we need to get its function cell 68 ;; we need to get its function cell
66 ;; definition. 69 ;; definition.
67 (x-popup-menu position (indirect-function map)))) 70 (x-popup-menu (or position (mouse-position)) (indirect-function map))))
68 ;; Strangely x-popup-menu returns a list. 71 ;; Strangely x-popup-menu returns a list.
69 ;; mouse-major-mode-menu was using a weird: 72 ;; mouse-major-mode-menu was using a weird:
70 ;; (key-binding (apply 'vector (append '(menu-bar) menu-prefix events))) 73 ;; (key-binding (apply 'vector (append '(menu-bar) menu-prefix events)))