From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#15957: 24.3.50; Follow mode scrolling broken on Emacs trunk Date: Mon, 25 Nov 2013 17:42:21 +0100 Message-ID: <52937DED.9070304@gmx.at> References: <52909877.1070203@gmx.at> <5291D098.10507@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1385397794 29322 80.91.229.3 (25 Nov 2013 16:43:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Nov 2013 16:43:14 +0000 (UTC) Cc: Dmitry Antipov , 15957@debbugs.gnu.org To: Anders Lindgren Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 25 17:43:18 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VkzFk-0001mT-Bx for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Nov 2013 17:43:16 +0100 Original-Received: from localhost ([::1]:53686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkzFj-0008Jv-VE for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Nov 2013 11:43:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkzFb-0008Jl-Mi for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2013 11:43:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkzFW-0006nr-HP for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2013 11:43:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkzFW-0006nm-Dn for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2013 11:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VkzFV-00020K-Pl for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2013 11:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Nov 2013 16:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15957 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15957-submit@debbugs.gnu.org id=B15957.13853977597671 (code B ref 15957); Mon, 25 Nov 2013 16:43:01 +0000 Original-Received: (at 15957) by debbugs.gnu.org; 25 Nov 2013 16:42:39 +0000 Original-Received: from localhost ([127.0.0.1]:44772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VkzF8-0001ze-6V for submit@debbugs.gnu.org; Mon, 25 Nov 2013 11:42:38 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:51728) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VkzF5-0001zM-1g for 15957@debbugs.gnu.org; Mon, 25 Nov 2013 11:42:36 -0500 Original-Received: from [62.47.62.195] ([62.47.62.195]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LkxLZ-1VCkHg06Uf-00aixT for <15957@debbugs.gnu.org>; Mon, 25 Nov 2013 17:42:29 +0100 In-Reply-To: X-Provags-ID: V03:K0:R52vnh/ItwvKCnPTgtZ/FqaMHeej6EfP7htXJ27RoDFj26HtN4h P9IU0cxUOI/hrxeofK4lwHydEYvgsMMM/BWVRYQzgGEwhFO6ylQaOv1tailaIOGSIdmxilF BwMFG4pBgXCB58y5284imgjjvovhH5dF8CYsAjjJ58prJIrwiULdXdLmkXLY5KnaQEzeDzl M8ap5EpY28HiMv82pEAGg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80952 Archived-At: Forwarding Anders Lindgren's mail to 15957@debbugs.gnu.org and Dmitry Antipov. > Hi! > > I believe that I have found the problem. In `follow-calc-win-end', there is > a call to `(window-end win t)'. The `t' means "compute the up-to-date > position > if it isn't already recorded." The return value from this function is > clearly incorrect. The fact that the wrong window is selected is simply a > consequence of this. > > In the older Emacs (up to bzr revision 113752), this seems to work > correctly. However, in the newer (starting from bzt revision 113753) this > is broken. > > You can verify this using the (somewhat crude) package I've attached below. > It adds logging to some Follow mode functions that triggers when you run a > special variant of the scroll command, which it binds to Ctrl-z. Once the > command has been executed, you can view the result by invoking > `check-follow-report-log'. > > As `window-end' is part of the display engine, which I have no knowledge > about, I hand it over to you to address the problem. > > Sincerely, > Anders Lindgren > > Ps. Below is the logs which I have recorded. > > Revision 113752: > > (Start #) > (Start (inside w-c-b) #) > (follow-calc-win-end #) > ( edges # (12 2 747 450)) > ( ht # 448) > ( last-line-pos # 3594) > ( Pos visible #) > ( end # 3632) > <------- Correct > ... > > Revision 113753: > > (Start #) > (Start (inside w-c-b) #) > (follow-calc-win-end #) > ( edges # (12 2 726 450)) > ( ht # 448) > ( last-line-pos # 3594) > ( Pos visible #) > ( end # 873) > <-------- Incorrect > > > > > > On Mon, Nov 25, 2013 at 10:19 AM, Anders Lindgren wrote: > >> Hi! >> >> I tried something similar to the code you suggested. The code I tried >> checked both `follow-scroll-up' and `follow-post-command-hook'. It appears >> as though the selected window is changed somewhere in the post-command >> hook. This, however, does not occur when I call the post-command hook as a >> plain function. >> >> Also, I noticed that an old Emacs trunk I had laying around worked >> correctly, so I have spent some time to do a binary search of the bzr >> archive and found out that this broke in revision 113753, with the >> following log message: >> >> revno: 113753 >> >> committer: Dmitry Antipov >> >> branch nick: trunk >> >> timestamp: Thu 2013-08-08 08:42:40 +0400 >> >> message: >> >> Do not reset window modification event counters excessively. >> >> These leftovers and poor man's tricky methods to catch extra >> >> redisplay's attention are no longer needed. >> >> * frame.c (set_menu_bar_lines_1): >> >> * minibuf.c (read_minibuf_unwind): >> >> * window.c (Fset_window_start, set_window_buffer, window_resize_apply) >> >> (grow_mini_window, shrink_mini_window, window_scroll_pixel_based) >> >> (window_scroll_line_based, Fset_window_configuration): >> >> * xdisp.c (redisplay_window): Do not reset last_modified and >> >> last_overlay_modified counters. >> >> >> I will continue to narrow down the problem in the post-command hook, I'll >> let you know when I'm done. >> >> >> Sincerely, >> >> Anders Lindgren >> >> >> >> >> On Sun, Nov 24, 2013 at 11:10 AM, martin rudalics wrote: >> >>>> I really doubt that the code in `follow-scroll-up' is broken. >>> I didn't say so. >>> >>> >>>> Follow-mode >>>> is designed so that the rearrangement of the other windows (the ones >>> that >>>> follow the selected window) occur in the post-command hook (to allow >>>> Follow-mode to act upon all Emacs commands, not only it's special >>>> function). It appears that something has changed in the display engine, >>> or >>>> in the way that post-command-hook is called, that makes this mechanism >>>> fail. This could also account for the difference we see when the >>> function >>>> is called via a key sequence as compared to via M-x. >>> IIUC we'd have to find out when and where follow-mode expects the >>> selected window to be a certain window and why this sometimes fails. So >>> maybe you should try the change I suggested. >>> >>> >>>> This is also the reason why reported this as a bug, rather than digging >>>> into the code myself. However, I could try to add log code to Follow >>> mode, >>>> to check if I could try to figure out what is going on. >>> Please do that. >>> >>> Thanks, martin >>> >> >