Subject: bug#56393: Resetting long_line_optimization_p to 0

From: Gerd Möllmann <[email-masked]>
Date: Tue, 19 Jul 2022 13:20:01 +0200

Gregory Heytings <[email-masked]> writes:

>>
>> What I meant was resetting the flag without resetting the buffer.
>> For example in redisplay_window when it finds that the condition for
>> setting it true is no longer met.
>>
>
> It is indeed never reset.  It goes only in one direction: as soon as a
> buffer contains one "long enough" line, the specific optimizations are
> used, and the buffer continues to use them.

Okay.

>
> Such buffers are not common,

Right.

That's the reason I didn't want to tackle this problem in Emacs 21, BTW.
But I also did not have your idea at the time.

>
> I don't think it is necessary/useful to check after each iteration
> whether the buffer still contains long lines, especially given that
> these optimizations have a near-nil effect in buffers without long
> lines.

Correct.

Which leaves me with something to think about, of course: when redisplay
sets the flag in the buffer, then there's of course a time before that.
And the question is what can happen in that interval.  But not today.
I'll come back to you.

P.S. (for Michael Albinus, if he's still reading this thread >:-))

When replying to a message in Debbugs with 'F' (Gnus), the subject gets
changed to the original bug report subject.