summaryrefslogtreecommitdiff
path: root/lisp/info.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-07-21 23:34:59 +0300
committerJuri Linkov <juri@linkov.net>2021-07-21 23:34:59 +0300
commitebac285d0ee567ed86e14b871cf0bac2de8655db (patch)
tree7544b94da3c0b02f1ac1b0e1bd357b09423f54d3 /lisp/info.el
parent1493145e3048e057d8ac9e8c9c56d1f99a97eb53 (diff)
downloademacs-ebac285d0ee567ed86e14b871cf0bac2de8655db.tar.gz
emacs-ebac285d0ee567ed86e14b871cf0bac2de8655db.tar.bz2
emacs-ebac285d0ee567ed86e14b871cf0bac2de8655db.zip
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.
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el20
1 files changed, 9 insertions, 11 deletions
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)