Function: markers-in

markers-in is a function defined in marker.c.

Signature

(markers-in &optional BEG END)

Documentation

Return the list of markers in region BEG..END.

The list includes markers at BEG and at END.

View in manual

Probably introduced at or before Emacs version 32.1.

Source Code

// Defined in /usr/src/emacs/src/marker.c
{
  Lisp_Object res = Qnil;
  struct Lisp_Marker *tail;
  ptrdiff_t ibeg, iend;
  if (NILP (beg))
    ibeg = BEGV;
  else
    {
      CHECK_FIXNUM_COERCE_MARKER (beg);
      ibeg = clip_to_bounds (BEGV, XFIXNUM (beg), ZV);
    }
  if (NILP (end))
    iend = ZV;
  else
    {
      CHECK_FIXNUM_COERCE_MARKER (end);
      iend = clip_to_bounds (BEGV, XFIXNUM (end), ZV);
    }

  for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
    if (ibeg <= tail->charpos && tail->charpos <= iend)
      res = Fcons (make_lisp_ptr (tail, Lisp_Vectorlike), res);

  return res;
}