Function: overlay-lists

overlay-lists is a function defined in buffer.c.

Signature

(overlay-lists)

Documentation

Return a pair of lists giving all the overlays of the current buffer.

The car has all the overlays before the overlay center; the cdr has all the overlays after the overlay center. Recentering overlays moves overlays between these lists. The lists you get are copies, so that changing them has no effect. However, the overlays you get are the real objects that the buffer uses.

Aliases

semantic-overlay-lists (obsolete since 27.1)

Source Code

// Defined in /usr/src/emacs/src/buffer.c
{
  Lisp_Object before = Qnil, after = Qnil;

  for (struct Lisp_Overlay *ol = current_buffer->overlays_before;
       ol; ol = ol->next)
    before = Fcons (make_lisp_ptr (ol, Lisp_Vectorlike), before);
  for (struct Lisp_Overlay *ol = current_buffer->overlays_after;
       ol; ol = ol->next)
    after = Fcons (make_lisp_ptr (ol, Lisp_Vectorlike), after);

  return Fcons (Fnreverse (before), Fnreverse (after));
}