[Top][All Lists]

[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, 28 Nov 2021 15:44:13 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Sun, 28 Nov 2021 21:10:25 +0800
> Eli Zaretskii <eliz@gnu.org> writes:
> >> Hmm, thanks.  One small question though: what should I do in order to
> >> make a window's cursor invisible?
> > Prevent display_and_set_cursor from being called, I presume?
> What if the cursor is already displayed?  Is it OK to call
> erase_phys_cursor from redisplay_window?

Hmm... I guess it would be better to modify display_and_set_cursor so
that it only erases the cursor if needed, but doesn't display it.

> > There's also set_cursor_from_row, which calculates where to display
> > the cursor, and something should be done about that to indicate that
> > the cursor is not shown at all.
> set_cursor_from_row can just immediately return if I indicate that the
> cursor is invisible because point is before or after window start,
> correct?

Yes, but that function is the one that sets the data in window's
'cursor' member, so in this case set_cursor_from_row should somehow
indicate there that the cursor is not visible or something.  I think.
There are several places in the display code which look at that data
and rely on it.

> > And why only "before window start"? what about beyond window's end?
> I don't know how to get that information inside redisplay_window.
> AFAIU, it's not available until redisplay completes.

So you will have to add code somewhere that produces this information
and records it somewhere, right?  It would be not very useful to
support "point outside window, but only before the window" feature.

You will find in try_scrolling code that finds whether point is beyond
the window end.  You can do something similar where you need this

> I hope this isn't the case here, but I can't explain what the "X" here
> is in terms more specific than "I want the ability to have point outside
> the window".

I don't see any way around carefully reading the code and finding all
the places where we assume that point is visible, or make it visible
if it isn't.

reply via email to

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