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: Mon, 01 Oct 2018 16:52:40 +0300 Message-ID: <831s994vvb.fsf@gnu.org> References: <20180929140957.GB5008@ACM> <83lg7k5q2o.fsf@gnu.org> <20180929153729.GD5008@ACM> <83h8i85lr7.fsf@gnu.org> <20180929204113.GF5008@ACM> <837ej35tex.fsf@gnu.org> <20180930153646.GF6305@ACM> <83in2m52h1.fsf@gnu.org> <20181001125922.GC5947@ACM> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1538401870 27272 195.159.176.226 (1 Oct 2018 13:51:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2018 13:51:10 +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 Mon Oct 01 15:51:06 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 1g6ybK-0006ys-2m for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 15:51:06 +0200 Original-Received: from localhost ([::1]:38772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6ydQ-0000lt-DX for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 09:53:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6ydI-0000lb-2s for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 09:53:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6ydC-0002iX-Fh for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 09:53:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56668) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6ydC-0002iJ-B6 for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 09:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6ydC-0002j7-9R for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 09:53: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: Mon, 01 Oct 2018 13:53: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.153840197910469 (code B ref 32874); Mon, 01 Oct 2018 13:53:02 +0000 Original-Received: (at 32874) by debbugs.gnu.org; 1 Oct 2018 13:52:59 +0000 Original-Received: from localhost ([127.0.0.1]:60926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6yd9-0002im-2m for submit@debbugs.gnu.org; Mon, 01 Oct 2018 09:52:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6yd6-0002iR-Vp for 32874@debbugs.gnu.org; Mon, 01 Oct 2018 09:52:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6ycy-0002Sb-B3 for 32874@debbugs.gnu.org; Mon, 01 Oct 2018 09:52:51 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6ycy-0002SR-72; Mon, 01 Oct 2018 09:52:48 -0400 Original-Received: from [176.228.60.248] (port=1924 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g6ycx-0006dT-Q6; Mon, 01 Oct 2018 09:52:48 -0400 In-reply-to: <20181001125922.GC5947@ACM> (message from Alan Mackenzie on Mon, 1 Oct 2018 12:59:22 +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:150878 Archived-At: > Date: Mon, 1 Oct 2018 12:59:22 +0000 > Cc: 32874@debbugs.gnu.org > From: Alan Mackenzie > > > > Follow-mode also needs to be active on explicit scrolling commands such > > > as C-v. Also, after inserting a newline, subsequent windows need to be > > > scrolled down. After either of these, follow-mode laboriously starts > > > determining where all its windows have to start and end. There's nothing > > > in the display engine to help in this process. > > > I'm not sure you are right, since all of the situations you describe > > go through the function try_scrolling, which calls > > window-scroll-functions. > > I have the feeling we're at cross purposes somehow, here. I think the > display engine, by itself, is only ever going to be scrolling the > selected window. I'm saying that by using window-scroll-functions you can catch _any_ scrolling, and control what happens when the display engine wants to scroll. But I'm not selling anything. You said many times that you wished the display engine did part of the job in follow-mode, and that follow-mode could use some help from the display engine. I think by using window-scroll-functions you can get some of that, but if you don't see how, it's fine with me. > > > Currently when a middle or right hand window gets scrolled for any > > > reason, follow-mode has to determine how to scroll windows to the left of > > > it. It does this by making a first guess at a window-start, does > > > set-window-start, then moves forward through the window to see how close > > > window-end is to where it needs to be. If it's a line off, a different > > > starting position is chosen, and so on, until window-start gets correctly > > > placed. > > > > If there were a function set-window-end, the display engine itself could > > > move back over the text lines to find window-start far more efficiently > > > and directly than follow-mode can. > > > It should be very easy to write such a function, provided that you can > > pass it as argument the buffer position of the beginning of the last > > line in the window (not the end of that line). > > That sounds very strange. Where would the difficulty lie in the display > engine doing (forward-line -1) rather than the Lisp code? forward-line goes back one physical line, not one screen line. It isn't rocket science to start with the largest buffer position in the window, it's just a bit more complicated, so if we can start from the beginning of the screen line, it will make the job very easy.