From: Po Lu Date: Tue, 18 Jul 2023 08:17:28 +0000 (+0800) Subject: Merge remote-tracking branch 'origin/master' into feature/android X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef497028bd7ede3ab27843fae6d3fbe12cb8e9e2;p=emacs.git Merge remote-tracking branch 'origin/master' into feature/android --- ef497028bd7ede3ab27843fae6d3fbe12cb8e9e2 diff --cc lisp/mouse.el index 50c10880da7,1e1f0808f9f..6ccee8e18af --- a/lisp/mouse.el +++ b/lisp/mouse.el @@@ -206,11 -206,13 +206,16 @@@ always return a positive integer or zer ;; Provide a mode-specific menu on a mouse button. - (defun minor-mode-menu-from-indicator (indicator &optional event) -(defun minor-mode-menu-from-indicator (indicator &optional window) ++(defun minor-mode-menu-from-indicator (indicator &optional window event) "Show menu for minor mode specified by INDICATOR. + + INDICATOR is either a string object returned by `posn-object' or + the car of such an object. WINDOW may be the window whose mode + line is being displayed. + +EVENT may be the mouse event that is causing this menu to be +displayed. + Interactively, INDICATOR is read using completion. If there is no menu defined for the minor mode, then create one with items `Turn Off' and `Help'." @@@ -243,11 -260,10 +263,13 @@@ (defun mouse-minor-mode-menu (event) "Show minor-mode menu for EVENT on minor modes area of the mode line." (interactive "@e") - (let ((indicator (car (nth 4 (car (cdr event)))))) - (minor-mode-menu-from-indicator indicator event))) + (let* ((posn (event-start event)) + (indicator (posn-object posn)) + (window (posn-window posn))) - (minor-mode-menu-from-indicator indicator window))) ++ (minor-mode-menu-from-indicator indicator window event))) + +;; See (elisp)Touchscreen Events. +(put 'mouse-minor-mode-menu 'mouse-1-menu-command t) (defun mouse-menu-major-mode-map () (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)