Subject: bug#64596: 30.0.50; On FIXME: in src/buffer.c:1481 (force-mode-line-update)

From: Eli Zaretskii <[email-masked]>
Date: Thu, 13 Jul 2023 22:08:20 +0300

> Cc: [email-masked]
> Date: Thu, 13 Jul 2023 13:20:23 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> > AFAIU, the purpose of disabling redisplay optimizations is avoiding the
> > situation when the modification flag is unset in the buffer, but the
> > buffer was actually modified, and has to be redrawn.
> > If my understanding is correct,
> > current_buffer->prevent_redisplay_optimizations_p = true does not belong
> > to `force-mode-line-update', but rather to `restore-buffer-modified-p'.
> 
> I strongly suspect it doesn't belong in `force-mode-line-update`, indeed.

To the ALL branch or to both of them?

> > Stefan will tell, but I'm quite sure he wrote that FIXME because
> > removing that line caused regression in some situation.
> 
> Nope.  I put the FIXME simply because I realized that the code doesn't
> make sense: if that line is sometimes necessary, then I'm pretty sure it's
> not always sufficient.

Then I guess you or Ihor (or both) should try removing that line and
run with that for a while.

Alternatively, maybe in the case of ALL non-nil the code should set
the prevent_redisplay_optimizations_p flag of all the buffers that are
displayed in some window, since some redisplay optimizations are not
eligible when the mode-line is about to be updated.