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: Thu, 09 Dec 2021 10:02:32 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 09 Dec 2021 08:23:28 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > That's not what I had in mind.  What I had in mind was the situation
> > where point is outside of the window, and the portion of the buffer
> > shown in the window changes due to something that Emacs does.  If you
> > are saying that in all such situation we will bring point back into
> > the window, then my concern is addressed; but if not, we will not be
> > able to use the final fallback of recentering the window around point,
> > because that would move the window instead of redrawing the visible
> > portion of the buffer.
> 
> If point doesn't change, but something in the visible part of the buffer
> does, that part will be redrawn, keeping point and window start in their
> original locations.

I'm saying that if some part of the window needs to be redrawn, "the
last line of defense" we have there now, which is to center point in
the window, will not necessarily be available, and we need to do
something else if all the other methods in redisplay_window fail to
find a good window-start point.

> But maybe we should make it move point back into the window under this
> situation.  WDYT?

I already provided an example where this could not be what users
expect: some command inserts text before the window-start, which
causes the text shown in the window to move if we use the same
window-start position.  Now, window-start is a marker, so
theoretically we could use the same marker with the buffer position
updated due to the insertion, in which case the stuff displayed in the
window may stay unchanged.  But is this what users will expect?  And
if this is not what users expect, i.e. if we will need to recompute
window-start anew in that case, we cannot use the "recenter around
point" fallback.  Likewise with bringing point into the view: will
this be what users expect in the described situation?



reply via email to

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