emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrolling commands and skipping redisplay, was: Re: emacs rendering


From: Eli Zaretskii
Subject: Re: Scrolling commands and skipping redisplay, was: Re: emacs rendering comparisson between emacs23 and emacs26.3
Date: Fri, 17 Apr 2020 21:48:23 +0300

> Cc: address@hidden, address@hidden, address@hidden, address@hidden,
>  address@hidden
> From: Dmitry Gutov <address@hidden>
> Date: Fri, 17 Apr 2020 20:52:32 +0300
> 
> >> 4. From time to time, you will see point jump into the middle of the
> >> screen, when font-lock takes too long, apparently (or maybe it
> >> corresponds to GC pauses).
> >>
> >> This shouldn't happen because next-line only moves by one line.
> > And it doesn't.
> 
> What doesn't?

It doesn't happen when next-line only moves by one line, then stops
(as opposed to continue moving by one more line).

> > What happens is that Emacs is sometimes unable to
> > keep up with input, so when it comes to displaying the next screenful,
> > point is already more than 1 line below the window's end.  So Emacs
> > recenters.
> 
> I know. But these are internal details, which shouldn't affect the 
> observable behavior this much.

The display engine has no idea what happened or why.  All it knows is
that point is more than one line below the window-bottom.  That's the
basics of the MVC design of Emacs: redisplay is uncoupled from the
changes made by the commands.

That said, if you can find a way of avoiding that, by all means
propose a patch, I'm sure many users will be happier.

> And I'm not convinced that, if redisplay didn't happen, Emacs can't 
> decide that scrolling happened anyway.

What do you mean by "scrolling happened"?  Scrolling happens because
the display engine decides to move the window-start point.  But you
seem to use this in some other meaning.

> After all, if that was the case, then in the original problem
> scenario (floor C-v, see Emacs freeze after a while), after Emacs
> unfreezes, the window start would have been the same (or almost the
> same) as when Emacs stopped updating the screen.

What happens when Emacs "freezes" is that point moves, but the display
is not updated to reflect that.  When redisplay does have an
opportunity to kick in, it looks at the position of point, and decides
where to put the window-start given that (by default, the window-start
will be half-window above the line containing point).

> > That's why the special value of 101 was introduced: so that this
> > recentering never happens.
> 
> This bug basically makes lower values (which I personally would 
> otherwise choose to use, probably even the value of 1) frustratingly 
> unreliable.

Larger values become more and more reliable.

> Emacs clearly doesn't honor scroll-conservatively's description.

The description says:

  Scroll up to this many lines, to bring point back on screen.
  If point moves off-screen, redisplay will scroll by up to
  ‘scroll-conservatively’ lines in order to bring point just barely
  onto the screen again.  If that cannot be done, then redisplay
  recenters point as usual.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ^^^^^^^^^^^^^^^^^^^^^^^^

So I think we are okay wrt the description.  But once again, patches
are welcome to improve this behavior.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]