help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: prevent scroll-lock-mode from scrolling?


From: lee
Subject: Re: prevent scroll-lock-mode from scrolling?
Date: Mon, 20 Jun 2016 23:21:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: lee <lee@yagibdah.de>
>> Date: Mon, 20 Jun 2016 01:54:02 +0200
>> 
>> I turn on scroll-lock-mode to keep the point where it is and don't want
>> it to move.  Why would I expect it to move nonetheless?
>
> Because some buffer positions would be unreachable otherwise.

I can reach them no problem when I press the ScrollLock key again to
turn off ScrollLock.  That's what the key is for.  Besides, why can't
emacs scroll the buffer contents to where the cursor is no matter
whether the top or bottom of the buffer has come close?

Almost all buffer positions remain unreachable without pressing keys.

>> I was assuming that 'point' means the position where letters appear when
>> I type, i. e. where the cursor is.
>
> No, point is _buffer_ position where insertion happens.  It isn't a
> screen position.

ok

Scrolling usually refers to screen positions, though.

>> > 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.
>> 
>> They won't be unreachable because you can always turn off
>> scroll-lock-mode and move the cursor around.
>
> Yes, but turning the mode on and off is an annoyance.

It is much more annoying to turn on a mode that is supposed to prevent
the cursor from moving while scrolling just to find that the mode
doesn't do that.

>> Can you explain to me why the cursor remains at its position /on the
>> screen/ while I'm scrolling with scroll-lock-mode enabled all the time
>> like it should --- and then suddenly moves when the top or bottom of the
>> buffer contents come into view?
>
> See above: Emacs attempts to let you reach the buffer text below the
> cursor position.

That defeats scroll-lock-mode.

>> Scroll-lock-mode does that to me.
>
> I understand; this just means scroll-lock-mode is not doing what you
> want, it's doing something else.  Maybe someone will extend it to do
> what you want, or maybe there's already a similar mode that does.

That it doesn't do what I want is one thing, that it doesn't do what it
supposedly should do is another.  Let's see what it is supposed to do:


"Scroll-Lock minor mode[...]
When enabled, keys that normally move point by line or paragraph will
scroll the buffer by the respective amount of lines instead and point
will be kept vertically fixed relative to window boundaries during
scrolling."


Why would one want to keep the buffer position where insertions happen
at a fixed position which is relative to screen positions (only) while
scrolling?  Insertions can easily happen off screen anyway, and it is
irrelevant for this whether the cursor can reach every buffer position
while scrolling or not.

I think the flaw comes from changing the key bindings.  Changing them is
what makes screen positions unreachable by the cursor.

I guess I need to use the ScrollLock key as a modifier for cursor keys
so that they yield different symbols when ScrollLock is enabled, and
bind appropriate scrolling functions to these symbols in emacs.  That
should do what I want.


-- 
GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, X toolkit)
 of 2016-03-18 on heimdali



reply via email to

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