summaryrefslogtreecommitdiff
path: root/lisp/hi-lock.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2022-01-15 20:33:45 +0200
committerJuri Linkov <juri@linkov.net>2022-01-15 20:33:45 +0200
commitf19b34376a2fe9f6f06226fb9cb0cb92119dbdca (patch)
treeeed334aaf0d7da36dedc1a6ce29212f947186592 /lisp/hi-lock.el
parent7055104358ad51b8c49e120851ee5d4d3c909e6d (diff)
downloademacs-f19b34376a2fe9f6f06226fb9cb0cb92119dbdca.tar.gz
emacs-f19b34376a2fe9f6f06226fb9cb0cb92119dbdca.tar.bz2
emacs-f19b34376a2fe9f6f06226fb9cb0cb92119dbdca.zip
More fixes for recently committed context-menu additions from bug#52973
* lisp/hi-lock.el (highlight-symbol-at-mouse): New defalias. (hi-lock-face-symbol-at-mouse): Rename from hi-lock-symbol-at-mouse. (hi-lock-context-menu): Use thing-at-mouse and middle-separator. * lisp/man.el (Man-context-menu): Fix Man-at-mouse and use middle-separator. * lisp/mouse.el (context-menu-functions): Remove context-menu-online-search. Add occur-context-menu and dictionary-context-menu (bug#50552).
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r--lisp/hi-lock.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index b70d4a75690..b77f9181a9c 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -855,7 +855,8 @@ SPACES-REGEXP is a regexp to substitute spaces in font-lock search."
nil)
;;; Mouse support
-(defun hi-lock-symbol-at-mouse (event)
+(defalias 'highlight-symbol-at-mouse 'hi-lock-face-symbol-at-mouse)
+(defun hi-lock-face-symbol-at-mouse (event)
"Highlight symbol at mouse click EVENT."
(interactive "e")
(save-excursion
@@ -865,13 +866,13 @@ SPACES-REGEXP is a regexp to substitute spaces in font-lock search."
;;;###autoload
(defun hi-lock-context-menu (menu click)
"Populate MENU with a menu item to highlight symbol at CLICK."
- (save-excursion
- (mouse-set-point click)
- (when (symbol-at-point)
- (define-key-after menu [highlight-search-separator] menu-bar-separator)
- (define-key-after menu [highlight-search-mouse]
- '(menu-item "Highlight Symbol" highlight-symbol-at-mouse
- :help "Highlight symbol at point"))))
+ (when (thing-at-mouse click 'symbol)
+ (define-key-after menu [highlight-search-separator] menu-bar-separator
+ 'middle-separator)
+ (define-key-after menu [highlight-search-mouse]
+ '(menu-item "Highlight Symbol" highlight-symbol-at-mouse
+ :help "Highlight symbol at point")
+ 'highlight-search-separator))
menu)
(provide 'hi-lock)