Function: text-property-any
text-property-any is a function defined in textprop.c.
Signature
(text-property-any START END PROPERTY VALUE &optional OBJECT)
Documentation
Check text from START to END for property PROPERTY equaling VALUE.
If so, return the position of the first character whose property PROPERTY
is 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.
Probably introduced at or before Emacs version 19.20.
Source Code
// Defined in /usr/src/emacs/src/textprop.c
{
register INTERVAL i;
register ptrdiff_t e, pos;
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);
e = XFIXNUM (end);
while (i)
{
if (i->position >= e)
break;
if (EQ (textget (i->plist, property), value))
{
pos = i->position;
if (pos < XFIXNUM (start))
pos = XFIXNUM (start);
return make_fixnum (pos);
}
i = next_interval (i);
}
return Qnil;
}