summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>2000-09-26 15:34:39 +0000
committerDave Love <fx@gnu.org>2000-09-26 15:34:39 +0000
commitc5e648d9295320652cbb80eb1a5c006990861fde (patch)
treef73ff67214d34259b2498b2c8eb19ea4462bc1dc /lisp/mouse.el
parented837b9ec405d0dd15f53d798a6be4f5668fd9c7 (diff)
downloademacs-c5e648d9295320652cbb80eb1a5c006990861fde.tar.gz
(popup-menu): If POSITION is nil, set it using
mouse-position.
Diffstat (limited to 'lisp/mouse.el')
-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."
(plist-get (get map 'menu-pro) :filter))))
(if filter (funcall filter (symbol-function map)) map)))))
event)
+ (unless position
+ (let ((mp (mouse-position)))
+ (setq position (list (list (cadr mp) (cddr mp)) (car mp)))))
;; The looping behavior was taken from lmenu's popup-menu-popup
(while (and map (setq event
;; map could be a prefix key, in which case
;; we need to get its function cell
;; definition.
- (x-popup-menu position (indirect-function map))))
+ (x-popup-menu (or position (mouse-position)) (indirect-function map))))
;; Strangely x-popup-menu returns a list.
;; mouse-major-mode-menu was using a weird:
;; (key-binding (apply 'vector (append '(menu-bar) menu-prefix events)))