summaryrefslogtreecommitdiff
path: root/lisp/thingatpt.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/thingatpt.el')
-rw-r--r--lisp/thingatpt.el9
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.