diff options
author | Juri Linkov <juri@linkov.net> | 2021-09-12 20:32:02 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2021-09-12 20:32:02 +0300 |
commit | bd917088e69e71e77c15069f0751096141ca3f1a (patch) | |
tree | 149567f8d3e8e74662c85a708500cd49121c591d /lisp/thingatpt.el | |
parent | 4877ddeaf739af3a683d8686d1e2fa5e51960623 (diff) | |
download | emacs-bd917088e69e71e77c15069f0751096141ca3f1a.tar.gz emacs-bd917088e69e71e77c15069f0751096141ca3f1a.tar.bz2 emacs-bd917088e69e71e77c15069f0751096141ca3f1a.zip |
* lisp/thingatpt.el (thing-at-mouse): New function (bug#50256).
* lisp/net/dictionary.el: Add 'context-menu-dictionary' to
'context-menu-functions'.
(dictionary-search-word-at-mouse): New function.
(context-menu-dictionary): New function that uses 'thing-at-mouse'.
(dictionary-mouse-popup-matching-words): Remove stray 'selected-window'.
* lisp/textmodes/flyspell.el (flyspell-context-menu): Add '_click' arg.
Diffstat (limited to 'lisp/thingatpt.el')
-rw-r--r-- | lisp/thingatpt.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index ab17748df5b..8782c9eeb56 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -152,6 +152,15 @@ positions of the thing found." (cons real-beg end)))))))))) ;;;###autoload +(defun thing-at-mouse (event thing &optional no-properties) + "Return the THING at mouse click. +Like `thing-at-point', but tries to use the event +where the mouse button is clicked to find a thing nearby." + (save-excursion + (mouse-set-point event) + (thing-at-point thing no-properties))) + +;;;###autoload (defun thing-at-point (thing &optional no-properties) "Return the THING at point. THING should be a symbol specifying a type of syntactic entity. |