From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32874: Unwanted scrolling in edebug `f' command when follow-mode is active Date: Sun, 30 Sep 2018 10:35:50 +0300 Message-ID: <837ej35tex.fsf@gnu.org> References: <20180929140957.GB5008@ACM> <83lg7k5q2o.fsf@gnu.org> <20180929153729.GD5008@ACM> <83h8i85lr7.fsf@gnu.org> <20180929204113.GF5008@ACM> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1538292907 12474 195.159.176.226 (30 Sep 2018 07:35:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2018 07:35:07 +0000 (UTC) Cc: 32874@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 30 09:35:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6WFq-00037E-Gx for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Sep 2018 09:35:02 +0200 Original-Received: from localhost ([::1]:54089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WHx-0007ZL-4Q for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Sep 2018 03:37:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WHp-0007Yz-Ll for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2018 03:37:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6WHm-0006Tj-HF for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2018 03:37:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55119) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6WHm-0006Tf-D6 for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2018 03:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6WHm-0000OV-7Z for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2018 03:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Sep 2018 07:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32874 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32874-submit@debbugs.gnu.org id=B32874.15382929721454 (code B ref 32874); Sun, 30 Sep 2018 07:37:02 +0000 Original-Received: (at 32874) by debbugs.gnu.org; 30 Sep 2018 07:36:12 +0000 Original-Received: from localhost ([127.0.0.1]:59377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6WGy-0000NO-HK for submit@debbugs.gnu.org; Sun, 30 Sep 2018 03:36:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6WGw-0000NB-ES for 32874@debbugs.gnu.org; Sun, 30 Sep 2018 03:36:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6WGn-0004xd-BM for 32874@debbugs.gnu.org; Sun, 30 Sep 2018 03:36:05 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WGm-0004xQ-Sh; Sun, 30 Sep 2018 03:36:01 -0400 Original-Received: from [176.228.60.248] (port=2619 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g6WGm-0008J7-Fn; Sun, 30 Sep 2018 03:36:00 -0400 In-reply-to: <20180929204113.GF5008@ACM> (message from Alan Mackenzie on Sat, 29 Sep 2018 20:41:13 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:150786 Archived-At: > Date: Sat, 29 Sep 2018 20:41:13 +0000 > Cc: 32874@debbugs.gnu.org > From: Alan Mackenzie > > > I'd actually urge you to have a good look at window-scroll-functions > > as well. (Follow mode already uses it, but I think it could use it > > for quite a lot more.) This hook is called when Emacs concludes that > > a window may need to be scrolled to bring point into view. This is > > exactly where Follow mode wants to be able to affect the decision of > > the display engine, right? I think by making a few simple > > changes/extensions where this hook is called, we could make the work > > of Follow mode quite a lot easier, by letting it rely on the display > > engine instead of trying to maneuver the display engine to do what it > > wants. > > I've had a look at window-scroll-functions, but I can't see what you > must be seeing. Currently, the documentation warns against trying to > influence the scrolling, saying "it probably won't work anyway". But you don't want to scroll yourself, you just want to switch the selected window and move point so that Emacs won't need to scroll. AFAIU, follow-mode wants to kick in when point goes off the selected window. And the call to window-scroll-functions is exactly the place where the display engine decides it needs to scroll the window, but didn't actually scroll it yet. So that looks like a good place to have follow-mode do its thing. We might need to add some simple facility for follow-mode to use, so that it could signal the display engine not to scroll the window. Other than that, I think this possibility is worth exploring. The advantage of using window-scroll-functions is that pre-redisplay-function is called much more frequently, in most cases follow-mode will need to do nothing at all. You probably already have a logic for detecting when it should do something, but if you are invoked from window-scroll-functions, most if not all of that logic will be redundant. > Maybe it would be relatively simple to introduce new functionality. > Something like "scroll window so that window-end gets the given value". I'm not sure I understand how this could help follow-mode. Please elaborate.