Ben Wing <ben(a)666.com> writes:
Gunnar Evermann wrote:
>
> resize_string also has problems if the string is shrunk as extents
> might have endpoints to the right of the new string end and therefore
> won't get adjusted.
the solutions are, i think:
[1] when replacing a character, callers should set POS to point to the beginning
of the following character. this should be clarified in the doc string of
resize_string().
[2] when calling adjust_extents[], we should use the old string length, not the
new one.
I had tried this and I think it will do for the case where the new
char is longer than the old one. It won't work if the string shrinks, I
think.
BTW. the function Ffillarray is completely broken as far as the
handling of extents is concerned, it doesn't even _try_ to adjust
them. The only other use of resize_string (in redisplay) should be ok,
as extents are explicitly detached before the resizing.
I am afraid I will have no time at all for XEmacs hacking till the end
of the month... I'll fix this then.
Gunnar