Subject: Re: bug#12872: 24.2; Provide a feature to trigger mode-line redisplay

From: Eli Zaretskii <[email-masked]>
Date: Sun, 05 Dec 2021 22:14:34 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked]
> Date: Sun, 05 Dec 2021 21:05:46 +0100
> 
> I don't quite see the use case, but we could fix force-mode-line-update
> in any case.  That is, add a parameter to only set w->update_mode_line?

How would that be different from what force-mode-line-update does now?
It sets the update_mode_line flag for the window's buffer, not just
for the window, and it also sets a flag to prevent redisplay
optimizations that could get in the way of the mode-line update.  What
do you suggest to do instead, and why would that be useful?

The problem with the update_mode_line flags is that they are
indiscriminate: the mode line shows a lot of data, each one of it
changes at different frequencies and due to different triggers.  If we
want a finer resolution there, we need to make these flags not just
simple booleans, but enumerations with several values, or maybe
bitmaps.  Then redisplay_window could be smarter about redrawing parts
of the mode line.