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 14:09:57 +0000 Message-ID: <20180929140957.GB5008@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1538230458 3217 195.159.176.226 (29 Sep 2018 14:14:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Sep 2018 14:14:18 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) To: 32874@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 29 16:14:14 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 1g6G0c-0000lk-1I for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Sep 2018 16:14:14 +0200 Original-Received: from localhost ([::1]:51147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6G2i-0005AI-IP for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Sep 2018 10:16:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6G2X-00059z-4f for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 10:16:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6G2M-00079n-C2 for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 10:16:12 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54762) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6G2M-00079h-8C for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 10:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6G2L-00088e-Uw for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 10:16: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 14:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32874 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.153823054531256 (code B ref -1); Sat, 29 Sep 2018 14:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Sep 2018 14:15:45 +0000 Original-Received: from localhost ([127.0.0.1]:59020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6G25-000883-Ey for submit@debbugs.gnu.org; Sat, 29 Sep 2018 10:15:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6G23-00087o-HN for submit@debbugs.gnu.org; Sat, 29 Sep 2018 10:15:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6G1x-00071n-Cx for submit@debbugs.gnu.org; Sat, 29 Sep 2018 10:15:38 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51513) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g6G1x-00071h-8w for submit@debbugs.gnu.org; Sat, 29 Sep 2018 10:15:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6G1w-00057a-Ev for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 10:15:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6G1t-0006zh-Ag for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 10:15:36 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:45022 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1g6G1t-0006yW-40 for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 10:15:33 -0400 Original-Received: (qmail 80626 invoked by uid 3782); 29 Sep 2018 14:15:30 -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 16:15:29 +0200 Original-Received: (qmail 20912 invoked by uid 1000); 29 Sep 2018 14:09:57 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:150759 Archived-At: Hello, Emacs. Start an edebug session in some Emacs Lisp source code, where the follow-mode is enabled for the .el buffer, and that buffer is displayed in at least two windows. Scroll the .el buffer until some sexp is split across two windows. When the execution point reaches this sexp, press f `edebug-forward-sexp'. What one sees is the left hand window wrongly scrolls upwards to display the end of the sexp, where point is left. This is wrong. Point ought to move the end of the sexp in the right hand window, without any scrolling. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; The immediate cause of this is at edebug--recursive-edit L+86, where there is a call to (sit-for 0). If this call is commented out, and the bug scenario repeated, there is no spurious scrolling. That call is there for a reason, however, so this isn't a fix for the bug. This (sit-for 0) calls redisplay, and this redisplay call bypasses the follow-mode manipulation, which is in a post-command-hook. The use of post-command-hook for follow mode is clearly suboptimal. Follow mode is essentially a part of redisplay, so it ought to get called from a redisplay hook. The trouble is, `redisplay-hook' doesn't exist. The best available hooks which might serve seem to be pre-redisplay-function or pre-redisplay-functions. Unfortunately, these are called too late, after redisplay has already determined which windows to operate on. The obvious solution would be to implement `redisplay-hook'. Since this is so obvious, yet wasn't done several decades ago, there are probably reasons for not doing it. Has anybody got any ideas for fixing this? -- Alan Mackenzie (Nuremberg, Germany).