[Top][All Lists]

[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: Thu, 19 Mar 2015 09:41:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>>> 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.
> In my experience errors in hooks are a pain to detect and debug.


> 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.

> I would have "4" (which presumably would happen around the time
> mark_window_display_accurate is run) call a different function so that
> the callee is aware of (1) whether the window's point/start/end
> positions are valid and (2) the fact that redisplay might not call it
> again before the end of the present redisplay cycle.

Sounds fine.  It would also solve the issue of changing the API so the
function can indicate whether a full redisplay is needed.

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.

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


reply via email to

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