next = next_interval (i);
while (! NULL_INTERVAL_P (next) && intervals_equal (i, next)
- && (NILP (limit) || next->position < XFASTINT (limit)))
+ && (NILP (limit)
+ || next->position - (STRINGP (object)) < XFASTINT (limit)))
next = next_interval (next);
if (NULL_INTERVAL_P (next))
return limit;
- if (! NILP (limit) && !(next->position < XFASTINT (limit)))
+ if (! NILP (limit)
+ && !(next->position - (STRINGP (object)) < XFASTINT (limit)))
return limit;
XSETFASTINT (position, next->position - (STRINGP (object)));
next = next_interval (next);
if (NULL_INTERVAL_P (next))
return 0;
- if (next->position >= end)
+ if (next->position - (STRINGP (object)) >= end)
return 0;
}
next = next_interval (i);
while (! NULL_INTERVAL_P (next)
&& EQ (here_val, textget (next->plist, prop))
- && (NILP (limit) || next->position < XFASTINT (limit)))
+ && (NILP (limit) || next->position - (STRINGP (object)) < XFASTINT (limit)))
next = next_interval (next);
if (NULL_INTERVAL_P (next))
return limit;
- if (! NILP (limit) && !(next->position < XFASTINT (limit)))
+ if (! NILP (limit)
+ && !(next->position - (STRINGP (object)) < XFASTINT (limit)))
return limit;
XSETFASTINT (position, next->position - (STRINGP (object)));
previous = previous_interval (i);
while (! NULL_INTERVAL_P (previous) && intervals_equal (previous, i)
&& (NILP (limit)
- || previous->position + LENGTH (previous) > XFASTINT (limit)))
+ || (previous->position + LENGTH (previous) - (STRINGP (object))
+ > XFASTINT (limit))))
previous = previous_interval (previous);
if (NULL_INTERVAL_P (previous))
return limit;
if (!NILP (limit)
- && !(previous->position + LENGTH (previous) > XFASTINT (limit)))
+ && !(previous->position + LENGTH (previous) - (STRINGP (object))
+ > XFASTINT (limit)))
return limit;
XSETFASTINT (position, (previous->position + LENGTH (previous)
- - (STRINGP (object))));
+ - (STRINGP (object))));
return position;
}
while (! NULL_INTERVAL_P (previous)
&& EQ (here_val, textget (previous->plist, prop))
&& (NILP (limit)
- || previous->position + LENGTH (previous) > XFASTINT (limit)))
+ || (previous->position + LENGTH (previous) - (STRINGP (object))
+ > XFASTINT (limit))))
previous = previous_interval (previous);
if (NULL_INTERVAL_P (previous))
return limit;
if (!NILP (limit)
- && !(previous->position + LENGTH (previous) > XFASTINT (limit)))
+ && !(previous->position + LENGTH (previous) - (STRINGP (object))
+ > XFASTINT (limit)))
return limit;
XSETFASTINT (position, (previous->position + LENGTH (previous)
- - (STRINGP (object))));
+ - (STRINGP (object))));
return position;
}
\f