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: Sat, 21 Mar 2015 10:58:01 +0100

> It could, but AFAIU, this is not the only situation that is being
> discussed.  Stefan wants redisplay to move point also in the case
> where some Lisp moved point and entered a region of buffer positions
> that has a certain text property.  That's not a scrolling scenario you
> describe.

Stefan will tell us whether he has any additional issues in mind.  Here
I'm only concerned about the scrolling scenario.

>>   > And cursor is always set where point is, we have no other strategy for
>>   > positioning the cursor.
>>
>> After `scroll-left'?
>
> Yes, after scroll-left, too.  We simply put the cursor as close to
> point as possible.

But not necessarily _where point is_.

>> Isn't adjust_point_for_property some sort of redisplay revisited?
>
> No.  It does nothing that is related to display.

Can't it trigger a new redisplay?

>> They would determine the position of the cursor when an intangible area
>> starts or ends within them.
>
> Sorry, too much "they" in this sentence, I don't really understand
> what you are sayin, or how it is relevant to the issue at hand.

Consider the following scenario:

(1) Using the scrollbar thumb, the user scrolls window text thus
    implicitly establishing a new window start position WS.

(2) Respecting WS, redisplay puts window point at some position WP.

(3) A function on `pre-redisplay-function' decides that WP would end up
    within intangible text and moves WP to a position WT.

(4) Redisplay notices that WT would end up in the scroll margin and
    scrolls the window invalidating WS.  As a result windw text would
    not scroll as intended by the user in (1).

But if redisplay were aware of intangible text, it would handle both -
the intangible property and the scroll margin - in (2) and there would
be no need to enter the (3)-(4) rigmarole.

Note that (3) means we have to search all text/overlay properties of
every window that gets redisplayed for the sole purpose of detecting the
presence of intangible text.  In my estimate 99.99% of our windows don't
contain such text.

martin



reply via email to

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