all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: lee <lee@yagibdah.de>
To: help-gnu-emacs@gnu.org
Subject: Re: prevent scroll-lock-mode from scrolling?
Date: Mon, 20 Jun 2016 23:21:45 +0200	[thread overview]
Message-ID: <8737o7eety.fsf@heimdali.yagibdah.de> (raw)
In-Reply-To: <83bn2w7wuy.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Jun 2016 17:34:13 +0300")

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	other threads:[~2016-06-20 21:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  1:12 prevent scroll-lock-mode from scrolling? lee
2016-06-17  1:25 ` Emanuel Berg
2016-06-17  4:14   ` Stefan Monnier
2016-06-17  6:00     ` Emanuel Berg
2016-06-17 22:40       ` Stefan Monnier
2016-06-18  1:19         ` what to require (was: Re: prevent scroll-lock-mode from scrolling?) Emanuel Berg
2016-06-17 22:47   ` prevent scroll-lock-mode from scrolling? lee
2016-06-17  6:47 ` Eli Zaretskii
2016-06-17 23:10   ` lee
2016-06-18  8:38     ` Eli Zaretskii
2016-06-19 23:54       ` lee
2016-06-20  8:33         ` tomas
2016-06-20 14:32           ` lee
2016-06-20 10:05         ` Dmitry Alexandrov
2016-06-20 15:24           ` lee
2016-06-20 16:12             ` Dmitry Alexandrov
2016-06-20 19:50               ` lee
2016-06-20 14:34         ` Eli Zaretskii
2016-06-20 21:21           ` lee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737o7eety.fsf@heimdali.yagibdah.de \
    --to=lee@yagibdah.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.