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: Po Lu
Subject: Re: Allowing point to be outside the window?
Date: Mon, 06 Dec 2021 10:11:47 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> 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.

>> For instance, we could enable the code that scrolls the window to follow
>> point if PT != w->point (if that makes sense).

> 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.

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.

Attachment: diff.diff
Description: Text Data

Thanks.

reply via email to

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