From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#32874: Unwanted scrolling in edebug `f' command when follow-mode is active Date: Sat, 29 Sep 2018 20:41:13 +0000 Message-ID: <20180929204113.GF5008@ACM> References: <20180929140957.GB5008@ACM> <83lg7k5q2o.fsf@gnu.org> <20180929153729.GD5008@ACM> <83h8i85lr7.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1538253911 15441 195.159.176.226 (29 Sep 2018 20:45:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Sep 2018 20:45:11 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 32874@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 29 22:45:07 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 1g6M6p-0003pe-P2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Sep 2018 22:45:03 +0200 Original-Received: from localhost ([::1]:52569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6M8w-0007b0-2b for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Sep 2018 16:47:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6M8p-0007aj-6T for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 16:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6M8k-0004y9-5r for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 16:47:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54963) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6M8k-0004xv-0k for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 16:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6M8j-0000rf-PE for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 16:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Sep 2018 20:47:01 +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.15382540103304 (code B ref 32874); Sat, 29 Sep 2018 20:47:01 +0000 Original-Received: (at 32874) by debbugs.gnu.org; 29 Sep 2018 20:46:50 +0000 Original-Received: from localhost ([127.0.0.1]:59221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6M8X-0000rE-FJ for submit@debbugs.gnu.org; Sat, 29 Sep 2018 16:46:50 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:29485 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1g6M8V-0000r4-Fg for 32874@debbugs.gnu.org; Sat, 29 Sep 2018 16:46:47 -0400 Original-Received: (qmail 27069 invoked by uid 3782); 29 Sep 2018 20:46:46 -0000 Original-Received: from acm.muc.de (p5B146BF5.dip0.t-ipconnect.de [91.20.107.245]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 29 Sep 2018 22:46:45 +0200 Original-Received: (qmail 19463 invoked by uid 1000); 29 Sep 2018 20:41:13 -0000 Content-Disposition: inline In-Reply-To: <83h8i85lr7.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:150772 Archived-At: Hello, Eli. On Sat, Sep 29, 2018 at 19:09:00 +0300, Eli Zaretskii wrote: > > Date: Sat, 29 Sep 2018 15:37:29 +0000 > > Cc: 32874@debbugs.gnu.org > > From: Alan Mackenzie > > > That's not true: pre-redisplay-function is called _before_ the display > > > engine determines what window(s) might need to be redrawn. > > Thanks! I'll have a look at pre-redisplay-function, and see if I can do > > anything with it. This was surprisingly easy. I've got a follow-mode function on pre-redisplay-function in place of the post-command-hook function, and it seems to be working. In particular, edebug's `f' now moves to the next window without spurious scrolling. The code badly needs tidying up, though. ;-) > 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". Maybe it would be relatively simple to introduce new functionality. Something like "scroll window so that window-end gets the given value". This would likely be easier to implement in the display engine than the rather clumsy iterative "point and shoot" approximations in follow.el. Maybe. -- Alan Mackenzie (Nuremberg, Germany).