Function: hproperty:overlay-range

hproperty:overlay-range is a byte-compiled function defined in hproperty.el.

Signature

(hproperty:overlay-range POS PROPERTY &optional VALUE)

Documentation

Return the first overlay range (start . end) at POS where PROPERTY = VALUE.

Return nil if no such overlay range. If POS is nil, use point. VALUE is optional; if omitted, use the first overlay at POS with PROPERTY.

Use hproperty:char-property-range for the same capability but for both text-properties and overlays.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hproperty.el
(defun hproperty:overlay-range (pos property &optional value)
  "Return the first overlay range (start . end) at POS where PROPERTY = VALUE.
Return nil if no such overlay range.  If POS is nil, use point.
VALUE is optional; if omitted, use the first overlay at POS with PROPERTY.

Use `hproperty:char-property-range' for the same capability but for
both text-properties and overlays."
  (unless pos (setq pos (point)))
  (let ((start pos)
        (end pos)
	val)
    (catch 'end
      (dolist (overlay (overlays-at pos t))
	(when (and (setq val (overlay-get overlay property))
		   (or (null value) (eq val value)))
          (setq start (overlay-start overlay)
		end   (overlay-end overlay))
	  (throw 'end nil))))
    (unless (= start end)
      (cons start end))))