Function: overlays-in
overlays-in is a function defined in buffer.c.
Signature
(overlays-in BEG END)
Documentation
Return a list of the overlays that overlap the region BEG ... END.
Overlap means that at least one character is contained within the overlay and also contained within the specified region.
Empty overlays are included in the result if they are located at BEG, between BEG and END, or at END provided END denotes the position at the end of the accessible part of the buffer.
The resulting list of overlays is in an arbitrary unpredictable order.
Other relevant functions are documented in the overlay group.
Probably introduced at or before Emacs version 19.30.
Shortdoc
;; overlay
(overlays-in 1 30)
e.g. => (#<overlay from 1 to 10 in *foo*>)
Aliases
semantic-overlays-in (obsolete since 27.1)
Source Code
// Defined in /usr/src/emacs/src/buffer.c
{
ptrdiff_t len, noverlays;
Lisp_Object *overlay_vec;
Lisp_Object result;
CHECK_FIXNUM_COERCE_MARKER (beg);
CHECK_FIXNUM_COERCE_MARKER (end);
if (!buffer_has_overlays ())
return Qnil;
len = 10;
overlay_vec = xmalloc (len * sizeof *overlay_vec);
/* Put all the overlays we want in a vector in overlay_vec.
Store the length in len. */
noverlays = overlays_in (XFIXNUM (beg), XFIXNUM (end), 1, &overlay_vec, &len,
true, false, NULL);
/* Make a list of them all. */
result = Flist (noverlays, overlay_vec);
xfree (overlay_vec);
return result;
}