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: Eli Zaretskii
Subject: Re: Allowing point to be outside the window?
Date: Sun, 05 Dec 2021 11:25:15 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: dick.r.chiang@gmail.com,  emacs-devel@gnu.org
> Date: Sun, 05 Dec 2021 17:15:25 +0800
> 
> >> I meant to ask whether or not I can forgo calculating whether point is
> >> outside the window, and just test whether or not cursor.vpos is -1 to
> >> determine if the cursor should be displayed, when point is allowed to be
> >> outside the window.
> >
> > No.  I think it should be the other way around: first see if point is
> > outside of the window, then force cursor.vpos to be negative.  That's
> > because redisplay resets that value to -1 whenever it isn't sure the
> > cursor will stay in its old position.
> 
> Thanks.  Another question or two: I can't use the value "-1" for
> cursor.vpos to indicate that point is outside the window, as it's
> already treated specially by redisplay, correct?

No, you can't.  But the question is why do you need to?  -1 there
means the cursor position is unknown.  Why do you need to know more
than that, plus the fact that point is _allowed_ to be outside of the
window?

> Also, where should I put the code to test if cursor is invisible?  I
> think it should be after the label force_start, as forcing the start
> could potentially adjust point to be inside the window.

It goes back to the same question I asked above: why do you need to
know that point is outside of the window? for what purposes?

IOW, why not just let redisplay do its thing, without bothering to
bring point into the window, when that is allowed?



reply via email to

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