emacs-devel
[Top][All Lists]
Advanced

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

Re: Allowing point to be outside the window?


From: Po Lu
Subject: Re: Allowing point to be outside the window?
Date: Sun, 05 Dec 2021 08:40:51 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Which commands did you try in addition to goto-char?  What about
> scrolling commands?

I haven't worked on any of the scrolling commands yet: they still keep
point inside the window.

>> The idea is that if `set_cursor_from_row' returns false (say if the
>> cursor was not found to be in the row), w->cursor_visible will also be
>> set to false.

> But you are just wasting cycles that way.  When it is known that point
> is outside of the window, that function will end up being called for
> every screen line we lay out.  Instead, just set the result without
> calling it in those cases.

>> I don't understand why set_cursor_from_row should be disabled though:
>> isn't it responsible for placing the cursor on the display (and as such,
>> isn't it required for the cursor to be displayed when point is _inside_
>> the window?).

> Yes.  I meant when you know that point is outside of the window.

Thanks, I understand your point now.

>> Doesn't `try_scrolling' try to constrain point inside if it is too near
>> the end of the window?

> Among other things, yes.  But its main purpose is not to move point,
> it's to find a suitable window-start position.

Thanks.

>> (And isn't the optimization that tries to decide whether or not to
>> blit the display if appropriate `scrolling_window' in dispextern.c?)

> scrolling_window belongs to the second phase of a redisplay cycle,
> where we actually deliver glyphs to the glass.  try_scrolling is from
> the first phase, where we decide what should be on the glass.
>
> In any case, both try_scrolling and scrolling_window are not about
> bringing point back into view, they are about redrawing the window so
> that it correctly reflects the buffer contents.  So these functions
> cannot and shouldn't be bypassed, even in this mode.
>
>> > The condition above doesn't check the keep_point_visible flag, why?

>> w->cursor_visible_p should always be true if keep_point_visible is not
>> nil by the time we get there.

> There should be a comment there about this, and perhaps also an
> assertion.

Okay, I will do that.  Thanks.


reply via email to

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