From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#21893: 25.0.50; Using scroll-*-command in follow-mode Date: Tue, 25 Jun 2019 23:10:50 +0300 Organization: LINKOV.NET Message-ID: <875zotzb69.fsf@mail.linkov.net> References: <877flnudud.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="157026"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 21893@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 25 22:12:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfrnb-000egW-0G for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jun 2019 22:12:15 +0200 Original-Received: from localhost ([::1]:35036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfrna-0004tL-1J for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jun 2019 16:12:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52036) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfrnR-0004pj-MC for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 16:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfrnP-0002hf-GJ for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 16:12:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48281) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfrnO-0002f8-Ga for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 16:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfrnO-0001hV-6d for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2019 16:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jun 2019 20:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21893 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 21893-submit@debbugs.gnu.org id=B21893.15614934686464 (code B ref 21893); Tue, 25 Jun 2019 20:12:02 +0000 Original-Received: (at 21893) by debbugs.gnu.org; 25 Jun 2019 20:11:08 +0000 Original-Received: from localhost ([127.0.0.1]:33592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfrmW-0001gC-01 for submit@debbugs.gnu.org; Tue, 25 Jun 2019 16:11:08 -0400 Original-Received: from anteater.elm.relay.mailchannels.net ([23.83.212.3]:6338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfrmU-0001g4-ME for 21893@debbugs.gnu.org; Tue, 25 Jun 2019 16:11:07 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 3133021720; Tue, 25 Jun 2019 20:11:05 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a33.g.dreamhost.com (100-96-11-129.trex.outbound.svc.cluster.local [100.96.11.129]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 61E77217F8; Tue, 25 Jun 2019 20:11:04 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a33.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Tue, 25 Jun 2019 20:11:05 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Wipe-Befitting: 36a7dcc7346eb581_1561493464952_2134588077 X-MC-Loop-Signature: 1561493464952:4236230911 X-MC-Ingress-Time: 1561493464952 Original-Received: from pdx1-sub0-mail-a33.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a33.g.dreamhost.com (Postfix) with ESMTP id 798C980A60; Tue, 25 Jun 2019 13:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=x7DOfFcqRZ/RaBOJFr6mD9GvrNY=; b= iDE1Lj8lROGx9NpBj5biyz1CQ8GwtcvummclsA2njVVRFenJ9vrPEUiFwVeKEAdH usyMNwpK35hbVcEKRhLmPaH7TjqcxWnqq/4hUGbakSg6K5HtVccuO62tPsrNjDmK 4aLT3XXPzu43qEK9ClI2tCq2968db7Jly1QaPDu1uWA= Original-Received: from mail.jurta.org (m91-129-109-209.cust.tele2.ee [91.129.109.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a33.g.dreamhost.com (Postfix) with ESMTPSA id 2B06280A42; Tue, 25 Jun 2019 13:10:57 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a33 In-Reply-To: (Lars Ingebrigtsen's message of "Tue, 25 Jun 2019 16:55:15 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudeggddugeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrddvtdelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrvddtledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegrtghmsehmuhgtrdguvgenucevlhhushhtvghrufhiiigvpedv X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161419 Archived-At: --=-=-= Content-Type: text/plain Hello, Alan. Lars reminded me of this old report that tries to add support for a non-nil value of scroll-error-top-bottom for scrolling in follow-mode. Now I updated the patch for the current master. Do you think this is the right fix? >> follow.el could use better commands scroll-up-command/scroll-down-command >> like in this patch to work smoothly when scroll-error-top-bottom is t, >> but a special condition in follow-scroll-up/follow-scroll-down >> that checks for scroll-preserve-screen-position prevents from scrolling >> and returns point to the old position, and there is no comment >> explaining this special-casing. > > [...] > >> - (scroll-up arg)) >> + (scroll-up-command arg)) > > Your patch basically replaces some of the calls to scroll-{up,down} with > scroll-{up/down}-command, which I think makes sense, since this is > supposed to emulate the normal scroll up/down commands, as far as I can > tell. > > But the patch no longer applies, and I don't use follow mode. Could a > follow mode user say whether this is what they'd expect, and if so, spin > a new patch? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=follow-scroll-command.patch diff --git a/lisp/follow.el b/lisp/follow.el index acc2b26c55..4269bf7cb1 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -557,7 +557,7 @@ follow-scroll-up-arg (let ((opoint (point)) (owin (selected-window))) (while ;; If we are too near EOB, try scrolling the previous window. - (condition-case nil (progn (scroll-up arg) nil) + (condition-case nil (progn (scroll-up-command arg) nil) (end-of-buffer (condition-case nil (progn (follow-previous-window) t) (error @@ -576,7 +576,7 @@ follow-scroll-down-arg This is an internal function for `follow-scroll-down' and `follow-scroll-down-window'." (let ((opoint (point))) - (scroll-down arg) + (scroll-down-command arg) (unless (and scroll-preserve-screen-position (get this-command 'scroll-command)) (goto-char opoint)) @@ -596,7 +596,7 @@ follow-scroll-up-window Works like `scroll-up' when not in Follow mode." (interactive "P") (cond ((not follow-mode) - (scroll-up arg)) + (scroll-up-command arg)) ((eq arg '-) (follow-scroll-down-window)) (t (follow-scroll-up-arg arg)))) @@ -616,7 +616,7 @@ follow-scroll-down-window Works like `scroll-down' when not in Follow mode." (interactive "P") (cond ((not follow-mode) - (scroll-down arg)) + (scroll-down-command arg)) ((eq arg '-) (follow-scroll-up-window)) (t (follow-scroll-down-arg arg)))) @@ -635,12 +635,14 @@ follow-scroll-up Works like `scroll-up' when not in Follow mode." (interactive "P") (cond ((not follow-mode) - (scroll-up arg)) + (scroll-up-command arg)) (arg (follow-scroll-up-arg arg)) (t (let* ((windows (follow-all-followers)) (end (window-end (car (reverse windows))))) - (if (eq end (point-max)) + (if (and (eq end (point-max)) + (or (null scroll-error-top-bottom) + (eobp))) (signal 'end-of-buffer nil) (select-window (car windows)) ;; `window-end' might return nil. @@ -663,13 +665,15 @@ follow-scroll-down Works like `scroll-down' when not in Follow mode." (interactive "P") (cond ((not follow-mode) - (scroll-down arg)) + (scroll-down-command arg)) (arg (follow-scroll-down-arg arg)) (t (let* ((windows (follow-all-followers)) (win (car (reverse windows))) (start (window-start (car windows)))) - (if (eq start (point-min)) + (if (and (eq start (point-min)) + (or (null scroll-error-top-bottom) + (bobp))) (signal 'beginning-of-buffer nil) (select-window win) (goto-char start) --=-=-=--