mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-18 06:01:22 -08:00
(popup-menu): If POSITION is nil, set it using
mouse-position.
This commit is contained in:
parent
876512abbb
commit
b52a30d869
1 changed files with 4 additions and 1 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue