Function: text-property-not-all

text-property-not-all is a function defined in textprop.c.

Signature

(text-property-not-all START END PROPERTY VALUE &optional OBJECT)

Documentation

Check text from START to END for property PROPERTY not equaling VALUE.

If so, return the position of the first character whose property PROPERTY is not eq to VALUE. Otherwise, return nil. If the optional fifth argument OBJECT is a buffer (or nil, which means the current buffer), START and END are buffer positions (integers or markers). If OBJECT is a string, START and END are 0-based indices into it.

View in manual

Probably introduced at or before Emacs version 19.17.

Source Code

// Defined in /usr/src/emacs/src/textprop.c
{
  register INTERVAL i;
  register ptrdiff_t s, e;

  if (NILP (object))
    XSETBUFFER (object, current_buffer);
  i = validate_interval_range (object, &start, &end, soft);
  if (!i)
    return (NILP (value) || EQ (start, end)) ? Qnil : start;
  s = XFIXNUM (start);
  e = XFIXNUM (end);

  while (i)
    {
      if (i->position >= e)
	break;
      if (! EQ (textget (i->plist, property), value))
	{
	  if (i->position > s)
	    s = i->position;
	  return make_fixnum (s);
	}
      i = next_interval (i);
    }
  return Qnil;
}