Subject: Re: bug#57434: 28.1.91; Terminal Emacs Mac OS flickering.

From: Dmitrii Kuragin <[email-masked]>
Date: Mon, 29 Aug 2022 09:03:15 -0700

No, I see flickering during scrolling.

And the problem is much worse when I have line number mode enabled.

The buffers do not change, and the frame at the same position, but line
numbers change because they're in 'visual mode (relative numbers).

On Mon, Aug 29, 2022 at 9:01 AM Eli Zaretskii <[email-masked]> wrote:

> > From: Dmitrii Kuragin <[email-masked]>
> > Date: Mon, 29 Aug 2022 07:18:43 -0700
> > Cc: Gerd Möllmann <[email-masked]>,
> >       [email-masked]
> >
> > I compiled with `-O0 -g3`, then
> > ```
> > lldb
> > (lldb) file nextstep/Emacs.app/Contents/MacOS/Emacs
> > Current executable set to
> '/Users/kuragin/Desktop/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs'
> > (x86_64).
> > (lldb) breakpoint set -f scroll.c -l 270
> > Breakpoint 1: where = Emacs`do_scrolling + 485 at scroll.c:271:11,
> address = 0x0000000100032da5
> > ```
> >
> > But, it doesn't stop there...
>
> Why scroll.c:271, when the code you patched begins on line 684?
>
> > When I have line numbers enabled, I assume, the scrolling logic would
> always try to insert/delete/write lines. In
> > my case it might be:
> >  - Writing (Is that writing on top of the current lines?) is cheaper.
> >  - Screen flickers because of the specific frequency of the terminal (or
> the way we flush the buffer).
> >    For example, we insert empty lines and then the screen is updated,
> only then we add content in there and
> > redisplay again.
> >
> > Potentially, some redrawing might happen inside of `ins_del_lines`?
> Instead of redrawing the whole screen,
> > we redraw it in the middle of modifying it?
>
> There shouldn't be any redrawing when none of the shown buffers
> changes in any way.  You see flickering when Emacs is completely idle,
> yes?
>

-- 
*If you get an email from me outside of the 9-5 it is *not* because I'm
always on or expect an immediate response from you; it is because of work
flexibility
<http://www.inc.com/john-boitnott/how-flexible-hours-can-create-a-better-work-life-balance.html>
.  Evening and weekend emails are a sign I allocated some regular working
hours for other things (such as family, gym, friends,...).  And I encourage
you to feel free to do the same.