From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lee Newsgroups: gmane.emacs.help Subject: Re: prevent scroll-lock-mode from scrolling? Date: Mon, 20 Jun 2016 23:21:45 +0200 Organization: my virtual residence Message-ID: <8737o7eety.fsf@heimdali.yagibdah.de> References: <871t3waaa8.fsf@heimdali.yagibdah.de> <83eg7wcnwj.fsf@gnu.org> <8760t7l8cg.fsf@heimdali.yagibdah.de> <834m8qc2nb.fsf@gnu.org> <87mvmgpwf9.fsf@heimdali.yagibdah.de> <83bn2w7wuy.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466458944 19849 80.91.229.3 (20 Jun 2016 21:42:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2016 21:42:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 20 23:42:23 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bF6xb-0005hq-Jy for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Jun 2016 23:42:23 +0200 Original-Received: from localhost ([::1]:46723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF6xa-0003Zs-NR for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Jun 2016 17:42:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF6vL-0002Jj-CL for help-gnu-emacs@gnu.org; Mon, 20 Jun 2016 17:40:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF6vF-0003Sc-Tk for help-gnu-emacs@gnu.org; Mon, 20 Jun 2016 17:40:02 -0400 Original-Received: from acheron.yagibdah.de ([185.55.75.245]:52696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF6vF-0003SR-Ma for help-gnu-emacs@gnu.org; Mon, 20 Jun 2016 17:39:57 -0400 Original-Received: from heimdali.yagibdah.de ([192.168.3.20]) by acheron.yagibdah.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.85) (envelope-from ) id 1bF6vD-0001In-Cv for help-gnu-emacs@gnu.org; Mon, 20 Jun 2016 23:39:55 +0200 Original-Received: from lee by heimdali.yagibdah.de with local (Exim 4.87) (envelope-from ) id 1bF6vD-0003fs-9u for help-gnu-emacs@gnu.org; Mon, 20 Jun 2016 23:39:55 +0200 In-Reply-To: <83bn2w7wuy.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Jun 2016 17:34:13 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Mail-Followup-To: help-gnu-emacs@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.55.75.245 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110540 Archived-At: Eli Zaretskii writes: >> From: lee >> 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