emacs-devel
[Top][All Lists]
Advanced

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

Re: Can we make set_point_both less expensive?


From: Stefan Monnier
Subject: Re: Can we make set_point_both less expensive?
Date: Wed, 18 Mar 2015 15:24:35 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> We don't have to have an endless loop.  We can decide to stop the loop
>> at any point.   Since such inf-loop would be an error in any case it's
>> perfectly OK to end up with an "incorrect" display.
> The loop wouldn't be "an error in any case".  It would be the result of
> an interaction of the function on the hook and the display engine.

Right, but such an interaction is undesirable, so it would reflect
a misbehavior, i.e. an error.

>> Currently we decide to stop the loop before it can even start, so we end
>> up with an incorrect display even if there would not be any such
>> inf-looping.
> I'd be among the first to appreciate a hook that is run once after the
> display engine has established new window-start/-end/-point positions.
> But having the display engine potentially call that hook again and again
> would scare me.

I don't want an inf-loop either.
Basically, I'd want something like:
1- pre-redisplay-function
2- do redisplay
3- point is out of the window, so move point
4- pre-redisplay-function again
5- do redisplay again
6- point is out of the window again, so move point again but without
   going through a new redisplay loop (might want to record the problem
   in *Messages* instead)

tho the exact behavior of 6 is not very important to me (as long as
it doesn't loop indefinitely).

Also, step (4) will often do nothing in which case we should be able to
skip 5 and 6.  For that we might need to slightly change
pre-redisplay-function by making it return whether something was changed
or not.


        Stefan



reply via email to

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