diff options
author | Dave Love <fx@gnu.org> | 2000-09-26 15:34:39 +0000 |
---|---|---|
committer | Dave Love <fx@gnu.org> | 2000-09-26 15:34:39 +0000 |
commit | c5e648d9295320652cbb80eb1a5c006990861fde (patch) | |
tree | f73ff67214d34259b2498b2c8eb19ea4462bc1dc /lisp/mouse.el | |
parent | ed837b9ec405d0dd15f53d798a6be4f5668fd9c7 (diff) | |
download | emacs-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.el | 5 |
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))) |