From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50234: 28.0.50; Horizontal scrolling doesn't keep the point in view Date: Sat, 28 Aug 2021 11:35:32 +0300 Message-ID: <83o89inezv.fsf@gnu.org> References: <87sfyuuid2.fsf@secretsauce.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24790"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50234@debbugs.gnu.org To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 28 10:37:24 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJtq7-0006EP-MM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Aug 2021 10:37:23 +0200 Original-Received: from localhost ([::1]:59060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJtq5-0002bm-TU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Aug 2021 04:37:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJtpn-0002b2-RJ for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 04:37:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41818) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJtpl-0007oK-Vl for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 04:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJtpl-0003n3-MJ for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 04:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Aug 2021 08:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50234 X-GNU-PR-Package: emacs Original-Received: via spool by 50234-submit@debbugs.gnu.org id=B50234.163013976614487 (code B ref 50234); Sat, 28 Aug 2021 08:37:01 +0000 Original-Received: (at 50234) by debbugs.gnu.org; 28 Aug 2021 08:36:06 +0000 Original-Received: from localhost ([127.0.0.1]:53364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJtoo-0003lR-UN for submit@debbugs.gnu.org; Sat, 28 Aug 2021 04:36:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJtof-0003kf-JI; Sat, 28 Aug 2021 04:35:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57326) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJtoa-0006ok-7n; Sat, 28 Aug 2021 04:35:48 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1632 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJtoZ-0002Gw-Qq; Sat, 28 Aug 2021 04:35:48 -0400 In-Reply-To: <87sfyuuid2.fsf@secretsauce.net> (message from Dima Kogan on Sat, 28 Aug 2021 00:40:57 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212859 Archived-At: tags 50234 wishlist thanks > From: Dima Kogan > Date: Sat, 28 Aug 2021 00:40:57 -0700 > > Hi. This is an old bug; I've been observing it for years. It isn't a bug, it might be a missing feature. Horizontal scroll commands were never coded to support scroll-preserve-screen-position. Only the vertical scroll commands support it. The documentation of scroll-preserve-screen-position says: Scroll commands should have the ‘scroll-command’ property on their symbols to be controlled by this variable. But: (get 'scroll-left 'scroll-command) => nil > 1. emacs -Q --eval '(global-set-key [C-M-right] (lambda () (interactive) (let ((scroll-preserve-screen-position t)) (scroll-left 3))))' > > Emacs comes up with the default text in the *scratch* buffer > > 2. (goto-char (point-min)) > > Move the point to the beginning of the buffer. (point) evaluates to 1 > > 3. C-M-right > > We scroll to the right. The point was on the left edge of the screen > at position 1, which is now out of view. Emacs still draws the point > at the left edge of the screen, implying that the point was moved to > stay in-bounds. But this is not where the point actually is: (point) > still evaluates to 1. I expect (point) to be updated with the new > position This is the expected behavior. The Emacs manual says: If the text is scrolled to the left, and point moves off the left edge of the window, the cursor will freeze at the left edge of the window, until point moves back to the displayed portion of the text. > 4. C-a > > Now, some commands behave strangely. For instance C-a should move to > the start of the line. This is now off-screen, so I would expect > emacs to scroll back so that we can see the beginning of the line. > But emacs does nothing: the point was at position 1, and it was moved > to position 1, so it doesn't see the need to scroll anything. This is also expected, since horizontal scroll command affect the automatic hscrolling, as described in the manual: If you use those commands to scroll a window horizontally, that sets a lower bound for automatic horizontal scrolling. Automatic scrolling will continue to scroll the window, but never farther to the right than the amount you previously set by ‘scroll-left’. Bottom line: if we want scroll-preserve-screen-position to affect horizontal scrolling in some (as yet to be defined) way, we need to code that. Other than that, what you report here is the expected and documented behavior. Thanks.