[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 23.0.60; Constant recentering with scroll-margin set

From: Miles Bader
Subject: Re: 23.0.60; Constant recentering with scroll-margin set
Date: Wed, 13 Aug 2008 11:33:24 +0900

Stefan Monnier <address@hidden> writes:
>> What do people think?  When there is a scroll-margin, should
>> move-to-window-line automagically move to the scroll-margin instead of
>> recentering?
> I never used it, neither interactively nor programmatically, so I don't
> have a strong opinion on that.  Reading the docstring I get the
> impression that the intention is to place the cursor at a particular
> location within the window, rather than to place point at a particular
> location within the buffer.  So that leads me to think that it should
> never cause recentering.  Maybe if the operation cannot be performed,
> the function should return the number of lines "left".

I use this function constantly -- I have simple wrappers bound to M-,
M-/ and M-. to move to the top, middle, and bottom of the window.

I almost never use a non-zero scroll-margin, so I don't have that much
experience with this problem, but I agree that it feels kind of weird if
move-to-window-line causes scrolling.

I kinda wish it would simply "disobey" the scroll-margin and locate the
cursor there without scrolling, but that probably isn't easy to

The suggested behavior of "stopping short", by having it move to line
(min (max N scroll-margin) (- window-height scroll-margin)) seems
reasonable interactively.

It might surprise some programmatic users, but on the other hand,
scrolling will probably surprise them too, so I guess there's really not
much you can do in that case; such code probably simply isn't prepared
to deal with a non-zero scroll-margin...


`To alcohol!  The cause of, and solution to,
 all of life's problems' --Homer J. Simpson

reply via email to

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