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: Mon, 06 Dec 2021 16:13:37 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Mon, 06 Dec 2021 10:11:47 +0800
> 
> > That'd cover scrolling a window in a way that leaves point outside of
> > it.  But Emacs also sets the window-start position in other
> > situations.  Moreover, the display engine itself does that, see
> > redisplay_window.
> 
> > So some logic and/or flags will be needed to distinguish between the
> > cases.
> 
> We should not recenter the display in any case where the start is not
> forced and point is not moved.

Again, what do you mean by "start is forced"?  Emacs sometimes forces
the window-start upon itself, you can clearly see that in the code.

And if point is outside of the window, recentering makes no sense
anyway, because there's nothing to recenter about, there's no point of
reference for it.

> > So any change in the numerical value of point will scroll the window
> > to bring point into the view?  That'd be fine if that's what users
> > expect.  But do they?  E.g., what happens if point is below the
> > window, and you paste (with the mouse) some text into the visible
> > portion of the window (which doesn't show point)?
> 
> That's not a problem, as `mouse-yank-primary' and friends already call
> mouse-set-point.

"Not a problem" because point will be brought back into the window
before pasting?  But is that what users want?

> WDYT about the attached patch?  It recenters the display whenever PT !=
> w->last_point, and it seems to work very well.
> 
> It also introduces a new variable `scroll-move-point' that controls if
> the scrolling commands will try to move point to stay visible.

Thanks, I will look into this later.



reply via email to

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