aboutsummaryrefslogtreecommitdiff
path: root/compat-28.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-15 21:19:41 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-15 21:19:41 +0100
commitae4a2b5b4bad773976f3f60c33b42f43456d9094 (patch)
tree6f3bee7c124c06dde1f2e06963821a4b859dee75 /compat-28.el
parent5bf22d4398c82ce6c13769390fba68f98a47d53c (diff)
compat-28: Add bounds-of-thing-at-mouse
Diffstat (limited to 'compat-28.el')
-rw-r--r--compat-28.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/compat-28.el b/compat-28.el
index 6237ce0..e60ea41 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -740,6 +740,15 @@ where the mouse button is clicked to find a thing nearby."
(mouse-set-point event)
(thing-at-point thing no-properties)))
+(compat-defun bounds-of-thing-at-mouse (event thing) ;; <UNTESTED>
+ "Determine start and end locations for THING at mouse click given by EVENT.
+Like `bounds-of-thing-at-point', but tries to use the position in EVENT
+where the mouse button is clicked to find the thing nearby."
+ :feature thingatpt
+ (save-excursion
+ (mouse-set-point event)
+ (bounds-of-thing-at-point thing)))
+
;;;; Defined in macroexp.el
(compat-defun macroexp-warn-and-return (msg form &optional _category _compile-only _arg) ;; <OK>