From ebac285d0ee567ed86e14b871cf0bac2de8655db Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 21 Jul 2021 23:34:59 +0300 Subject: Improve docstring of context-menu-functions and add eww-context-menu * lisp/mouse.el (context-menu-functions): Explain function args in docstring. * lisp/net/eww.el (eww-context-menu): New function. (eww-mode): Add it to context-menu-functions. * lisp/info.el (Info-context-menu): Move history items higher. * lisp/progmodes/prog-mode.el (prog-context-menu): Add menu items in the middle of the menu after the region menu items. --- lisp/info.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index a8848a94758..14dc299295f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4147,14 +4147,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." ["Exit" quit-window :help "Stop reading Info"])) (defun Info-context-menu (menu) - (when (mouse-posn-property (event-start last-input-event) 'mouse-face) - (define-key menu [Info-separator-link-1] menu-bar-separator) - (define-key menu [Info-mouse-follow-nearest-node] - '(menu-item "Follow Link" Info-mouse-follow-nearest-node - :help "Follow a link where you click")) - (define-key menu [Info-separator-link-2] menu-bar-separator)) - - (define-key-after menu [Info-separator-1] menu-bar-separator) + (define-key menu [Info-separator-2] menu-bar-separator) (let ((easy-menu (make-sparse-keymap "Info"))) (easy-menu-define nil easy-menu nil '("Info" @@ -4162,10 +4155,15 @@ If FORK is non-nil, it is passed to `Info-goto-node'." :help "Go back in history to the last node you were at"] ["Forward in History" Info-history-forward :visible Info-history-forward :help "Go forward in history"])) - (dolist (item (lookup-key easy-menu [menu-bar info])) + (dolist (item (reverse (lookup-key easy-menu [menu-bar info]))) (when (consp item) - (define-key-after menu (vector (car item)) (cdr item))))) - (define-key-after menu [Info-separator-2] menu-bar-separator) + (define-key menu (vector (car item)) (cdr item))))) + + (when (mouse-posn-property (event-start last-input-event) 'mouse-face) + (define-key menu [Info-mouse-follow-nearest-node] + '(menu-item "Follow Link" Info-mouse-follow-nearest-node + :help "Follow a link where you click"))) + (define-key menu [Info-separator-1] menu-bar-separator) menu) -- cgit v1.2.3