Function: thing-at-mouse

thing-at-mouse is an autoloaded and byte-compiled function defined in thingatpt.el.gz.

Signature

(thing-at-mouse EVENT THING &optional NO-PROPERTIES)

Documentation

Return the THING at mouse click specified by EVENT.

Like thing-at-point, but tries to use the position in EVENT where the mouse button is clicked to find the thing nearby.

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/thingatpt.el.gz
;;;###autoload
(defun thing-at-mouse (event thing &optional no-properties)
  "Return the THING at mouse click specified by EVENT.
Like `thing-at-point', but tries to use the position in EVENT
where the mouse button is clicked to find the thing nearby."
  (save-excursion
    (mouse-set-point event)
    (thing-at-point thing no-properties)))