Function: next-char-property-change

next-char-property-change is a function defined in textprop.c.

Signature

(next-char-property-change POSITION &optional LIMIT)

Documentation

Return the position of next text property or overlay change.

This scans characters forward in the current buffer from POSITION till it finds a change in some text property, or the beginning or end of an overlay, and returns the position of that. If none is found, and LIMIT is nil or omitted, the function returns (point-max).

If the optional second argument LIMIT is non-nil, the function doesn't search past position LIMIT, and returns LIMIT if nothing is found before LIMIT. LIMIT is a no-op if it is greater than (point-max).

Probably introduced at or before Emacs version 20.1.

Source Code

// Defined in /usr/src/emacs/src/textprop.c
{
  Lisp_Object temp;

  temp = Fnext_overlay_change (position);
  if (! NILP (limit))
    {
      CHECK_FIXNUM_COERCE_MARKER (limit);
      if (XFIXNUM (limit) < XFIXNUM (temp))
	temp = limit;
    }
  return Fnext_property_change (position, Qnil, temp);
}