Subject: Re: bug#77942: 31.0.50; replace-region-contents gets stuck

From: Stefan Monnier <[email-masked]>
Date: Tue, 22 Apr 2025 14:22:51 -0400

>> >> >> MAX-SECS isn't working as expected said Stef elsewhere.
>> >> > If you set it to zero, it must work as expected.  If it doesn't, it's
>> >> > a bug.
>> >> He does want to trigger the diff code, tho.
>> > Why is that?
>> 
>> Because it's the diff code which does loads of conversions from charpos
>> to bytepos.
>
> But then waiting for a long time is actually what the doctor
> prescribed, as it collects a lot of statistics, no?

It would be if that time was spent in Emacs's side of the code, but in
that case it's all spent in `diffseq.h` without calling us back to look
at the buffer (which is what triggers the charpos->bytepos conversions
and lets us check the timeout as well).

        Stefan