emacs-devel
[Top][All Lists]
Advanced

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

Re: try_cursor_movement not called?


From: Po Lu
Subject: Re: try_cursor_movement not called?
Date: Thu, 02 Dec 2021 17:51:16 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: emacs-devel@gnu.org
>> Date: Thu, 02 Dec 2021 14:37:46 +0800
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Btw, why did you want to assume that? what did you want to do if
>> > window_end_valid were true?
>> 
>> I wanted to set w->cursor_valid_p (a field I added to `struct window')
>> to false there, if PT > w->window_end_pos.
>
> So you want to know whether point is beyond the window's end?  That's
> possible; we do that in several places in the existing code.  It's
> just slightly more complicated than a simple comparison with a known
> value, and requires to use the move_it_* functions.  Basically, you
> tell move_it_to to move to PT or to last_visible_y, whichever happens
> first, and then examine the results: if it reached PT, then point is
> inside the window, otherwise it isn't.

Thanks.  I looked at some of the code in try_scrolling and I think I
understand how it works now.

> But beware of the underwater rocks: the window could end in some
> display property, like display string or image, or in a an overlay
> string.  These cases require special care with the move_it_*
> functions.

However, I don't know about this.  Could you perhaps elaborate further?


reply via email to

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