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: Dmitry Gutov
Subject: Re: Scrolling commands and skipping redisplay, was: Re: emacs rendering comparisson between emacs23 and emacs26.3
Date: Mon, 20 Apr 2020 20:04:06 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 20.04.2020 18:01, Eli Zaretskii wrote:

It's not a "merge" and not an optimization, it's how Emacs was
designed.  It only enters redisplay when it's idle.  If you invoke
commands one after another quickly enough, more than one command will
be executed before the next redisplay cycle.

The fact that Emacs's behavior can depend on when redisplay happens, and
the user cannot reliably control it, is problematic IMHO.

Please be specific: what Emacs's behavior can depend on when redisplay
happens, apart from whether something was or wasn't updated on
display?

The window's scroll position.

Again: you (setq scroll-conservatively 1) and lean on C-n for a little while. Depending on whether Emacs manages to redisplay after every command invocation, the point will, or will not, scroll to the middle of the window. It could do that several times as well.

At the beginning of each command, we can save the value of point. If, at
the end, we're still in the same buffer, and the new value of point
fails the scroll-conservatively check, count the lines between the
previous value of point and the new one. If that number is <=
scroll-conservatively, then scroll "conservatively" anyway.

And if not, then what?

Then give up and move point to the middle of the window.

But that's again "not good" according to your opinion, isn't it?

Why wouldn't my suggestion be good enough?

Or
maybe you assume this will solve most of the cases when we currently
recenter under scroll-conservatively < 101?

All important ones, yes.

Anyway, scrolling commands don't normally move point, they move the
window-start.  Point then moves because redisplay brings it into
view.  So I don't think your algorithm will work, at least not in the
usual case.

I'm a lot less worried about scrolling "conservatively" when the user
actually invokes the scrolling commands.

Ahem... the thread's title begins with "scrolling commands",so I
thought we were still discussing that?

The amount of times I have mentioned 'C-n' might have persuaded otherwise.

What you describe might be relevant to "scrolling" that happens if you
lean on C-n, not on C-v.

C-n, or C-M-e, or C-s. These are indeed scenarios when the current
behavior can be most surprising.

Is it?  Just out of habit, I suppose.  What Emacs does make a lot of
sense: it shows you the optimal amount of context.  By contrast,
scroll-conservatively shows you only one side of that context, and
usually the wrong side.

Are we going to argue whether scroll-conservatively is useful? I hope not. And if didn't assign value to that "optimal amount of context" thing you mention, I'd be arguing in favor of making scroll-conservatively a boolean instead.



reply via email to

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