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: martin rudalics
Subject: Re: Can we make set_point_both less expensive?
Date: Fri, 20 Mar 2015 09:08:25 +0100

>> So I'd rather try to inhibit potential misbehavior than to fix it.
>
> Not running the hook a second time (like we do now) doesn't inhibit this
> bad interaction.
> And I'm not sure how we could actually inhibit this bad interaction.

By not running the same hook twice (AFAIAC a bad interaction is only one
where the function and redisplay try forever to annihilate each other's
actions).  Although one problem of `pre-redisplay-function' is that for
my taste it already runs a bit too often, for example, whenever we blink
the cursor.

> Tho, I'd expect that this function will need/want to do exactly the same
> as pre-redisplay-function, so maybe keeping a single function (but
> providing it with some extra argument/data to distinguish the two cases
> if/when needed) would work better.

But wouldn't we then have to change the signature of functions on
`pre-redisplay-function'?  In any case, I don't know yet about the major
use cases you have in mind.  `redisplay--update-region-highlights' is
not very overhead-intensive and thus probably not very representative
for what may follow.  With `scroll-restore-mode' I'm only interested in
calls where redisplay has already calculated the prospective position of
`window-point'.  The current version of `pre-redisplay-function' is not
useful for that.

> And it still wouldn't prevent bad interactions (this new hook could
> still move point out of the window), of course.

Yes.  And redisplay would move it back (or maybe not if we decide to
allow such behavior in general and not for horizontal scrolling alone).

martin



reply via email to

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