Function: bounds-of-thing-at-point-for-char-property

bounds-of-thing-at-point-for-char-property is a byte-compiled function defined in thingatpt.el.gz.

Signature

(bounds-of-thing-at-point-for-char-property PROPERTY)

Documentation

Determine the start and end buffer locations for the "thing" at point.

The "thing" is a region of text with the specified text PROPERTY (or overlay) set.

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/thingatpt.el.gz
(defun bounds-of-thing-at-point-for-char-property (property)
  "Determine the start and end buffer locations for the \"thing\" at point.
The \"thing\" is a region of text with the specified text PROPERTY (or
overlay) set."
  (let ((pos (point)))
    (when (or (get-char-property pos property)
              (and (> pos (point-min))
                   (get-char-property (setq pos (1- pos)) property)))
      (cons (previous-single-char-property-change
             (min (1+ pos) (point-max)) property)
            (next-single-char-property-change pos property)))))