From c5e648d9295320652cbb80eb1a5c006990861fde Mon Sep 17 00:00:00 2001 From: Dave Love Date: Tue, 26 Sep 2000 15:34:39 +0000 Subject: (popup-menu): If POSITION is nil, set it using mouse-position. --- lisp/mouse.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp/mouse.el') 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))) -- cgit v1.2.1