Mercurial > emacs
changeset 31912:83fe15f82f7e
(popup-menu): If POSITION is nil, set it using
mouse-position.
author | Dave Love <fx@gnu.org> |
---|---|
date | Tue, 26 Sep 2000 15:34:39 +0000 |
parents | 8354221b2ced |
children | 8e8bafe8c566 |
files | lisp/mouse.el |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/mouse.el Tue Sep 26 15:32:27 2000 +0000 +++ b/lisp/mouse.el Tue Sep 26 15:34:39 2000 +0000 @@ -59,12 +59,15 @@ (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)))