[Top][All Lists]

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

Re: prevent scroll-lock-mode from scrolling?

From: Eli Zaretskii
Subject: Re: prevent scroll-lock-mode from scrolling?
Date: Sat, 18 Jun 2016 11:38:48 +0300

> From: lee <address@hidden>
> Date: Sat, 18 Jun 2016 01:10:55 +0200
> Eli Zaretskii <address@hidden> writes:
> >> From: lee <address@hidden>
> >> Date: Fri, 17 Jun 2016 03:12:15 +0200
> >> 
> >> is there a way to prevent the point from moving up or down when
> >> scroll-lock-mode is enabled and the contents of the buffer have been
> >> scrolled so far as for the first or the last line to reach the top or
> >> the bottom of the frame, respectively?
> >> 
> >> It pretty much defeats the idea of this mode when the point moves
> >> nonetheless after scrolling for a bit, since I would use this mode to
> >> keep the point in its very place when scrolling.
> >
> > AFAIU, that's exactly the point of this minor mode.  If you don't like
> > it, I suggest not to turn on the mode.
> Well, what happens when you turn it on and your scrolling reaches the
> end of the buffer?
> The point moves towards the end of the buffer rather than that the
> buffer contents are scrolled up.

Yes, as I'd expect.  I'm still not sure I understand why is that a
problem in your case.

> >> Thinking of this, is there a kinda complementary mode, or an option, to
> >> scroll-lock-mode, which would move the point together with the contents
> >> of the buffer when I scroll?
> >
> > That's what happens by default, so I don't think I understand what are
> > you looking for.  Perhaps consider telling more about the feature you
> > want to have.
> You must somehow be scrolling very differently from how I scroll.

No, the problem is that your terminology is very different from what
we use in Emacs.  When you say "point moves", the usual meaning of
this is that point changes its buffer position.  But what you actually
mean is "cursor changes its screen position".

> Or perhaps I shouldn't say "scroll" but "move the point" instead.  When
> scroll-lock-mode is enabled and you move the point up or down (C-p or
> C-n), the buffer contents are scrolled down or up, respectively, while
> the point remains in one place.

No, point does change its buffer position, but the screen coordinates
of the cursor are kept constant as much as possible.

> Yet when you come close to the top or the end of the buffer, the
> point /does/ suddenly move up or down as if scroll-lock-mode was
> disabled.  That's what defeats the scroll-lock-mode entirely.
> I'd even say it's a bug, and that scrolling the buffer contents must
> stop when the top/bottom is reached.  Moving the point up or down is
> exactly what I /don't/ want when I enable scroll-lock-mode.  Whether the
> point should move left or right when scroll-lock-mode is enabled, or if
> the buffer contents should be scrolled right or left, should be
> configurable.

That might make sense in some use cases of view-mode (and even then
might get in the way), but not in a general-purpose editable buffer,
IMO.  It means some buffer positions are unreachable by
vertical-motion commands.

I still don't understand why the current behavior is a problem.  If
that's because it affects cursor position for future scrolls, you can
change that by cursor motion commands like C-f, C-b, M-f, M-b, etc.,
before you commence scrolling.

reply via email to

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