Subject: Re: bug#77039: 31.0.50; Flickering on macOS

From: Eli Zaretskii <[email-masked]>
Date: Sun, 23 Mar 2025 09:58:33 +0200

> From: Gerd Möllmann <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked],  [email-masked]
> Date: Sun, 23 Mar 2025 05:56:41 +0100
> 
> > Repro from emacs -Q:
> >
> > (defun foo ()
> > (Interactive)
> > (global-display-line-numbers-mode)
> > (term "/usr/bin/yes")
> > (switch-to-buffer "*scratch*"))
> >
> > Aaron
> 
> Thanks! I think I see now what's going on.
> 
> redisplay_internal has this (line numbers may differ):
> 
> xdisp.c:
> 17368       && (NILP (Vdisplay_line_numbers)
> 17369           || EQ (Vdisplay_line_numbers, Qvisual))
> 
> This means that certain redisplay optimizations that make redisplay
> particularly "cheap" are not tried, depending on line number display.

See bug#54091.

> Instead the more expensive redisplay methods are used that consider
> whole windows or parts of them and so on. Or, in other words, line
> number display can make redisplay less of a nop.

Yes, and there's little wonder it's so: certain changes in the buffer
and point position could potentially have effect on line numbers of
lines that are not involved in the change, so more thorough redisplay
is needed.