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#29325: 26.0.90: Info scrolling stuck Date: Tue, 21 Nov 2017 21:42:59 +0200 Message-ID: <837eujcta4.fsf@gnu.org> References: <83fu9ehuog.fsf@gnu.org> <83d14hidlk.fsf@gnu.org> <83r2sudwgv.fsf@gnu.org> <83r2ssd7eq.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1511293451 15474 195.159.176.226 (21 Nov 2017 19:44:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Nov 2017 19:44:11 +0000 (UTC) Cc: 29325@debbugs.gnu.org To: charles@aurox.ch (Charles A. Roelli) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 21 20:44:07 2017 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 1eHESk-0003hD-SC for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Nov 2017 20:44:07 +0100 Original-Received: from localhost ([::1]:36250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHESs-0008GC-AK for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Nov 2017 14:44:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHESl-0008Fw-9k for bug-gnu-emacs@gnu.org; Tue, 21 Nov 2017 14:44:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHESi-0007AS-6W for bug-gnu-emacs@gnu.org; Tue, 21 Nov 2017 14:44:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42751) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHESi-0007AL-2L for bug-gnu-emacs@gnu.org; Tue, 21 Nov 2017 14:44:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eHESg-0002dE-2a for bug-gnu-emacs@gnu.org; Tue, 21 Nov 2017 14:44:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Nov 2017 19:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29325 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29325-submit@debbugs.gnu.org id=B29325.151129340310060 (code B ref 29325); Tue, 21 Nov 2017 19:44:02 +0000 Original-Received: (at 29325) by debbugs.gnu.org; 21 Nov 2017 19:43:23 +0000 Original-Received: from localhost ([127.0.0.1]:51432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHES3-0002cB-C9 for submit@debbugs.gnu.org; Tue, 21 Nov 2017 14:43:23 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHES2-0002bw-6G for 29325@debbugs.gnu.org; Tue, 21 Nov 2017 14:43:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHERt-0006ox-Q3 for 29325@debbugs.gnu.org; Tue, 21 Nov 2017 14:43:16 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHERt-0006on-Lo; Tue, 21 Nov 2017 14:43:13 -0500 Original-Received: from [176.228.60.248] (port=4108 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eHERr-0004or-PM; Tue, 21 Nov 2017 14:43:13 -0500 In-reply-to: (charles@aurox.ch) 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:140214 Archived-At: > Date: Tue, 21 Nov 2017 20:24:05 +0100 > From: charles@aurox.ch (Charles A. Roelli) > CC: 29325@debbugs.gnu.org > > > Then I'd expect the same behavior to happen if you do "M-5 M-v" > > instead of turning the wheel. Does it? > > It does. Then let's abandon the wheel, and continue only with "M-5 M-v" from now on. > redisplay_internal 0 <= START FIRST SCROLL > 0x1360330 (*info*): forced window start > redisplay_preserve_echo_area (8) > redisplay_internal 0 > redisplay_preserve_echo_area (8) > redisplay_internal 0 > redisplay_internal 0 > redisplay_internal 0 <= START SECOND SCROLL > 0x1360330 (*info*): forced window start > redisplay_preserve_echo_area (8) > redisplay_internal 0 > redisplay_preserve_echo_area (8) > redisplay_internal 0 > redisplay_internal 0 <= START THIRD SCROLL (BROKEN) > redisplay_internal 0 > 0x1360330 (*info*): recenter > redisplay_preserve_echo_area (8) > redisplay_internal 0 > redisplay_preserve_echo_area (8) > redisplay_internal 0 > redisplay_internal 0 > > The third scroll should have reached the start of the buffer, but > recenters instead of doing so. Were you typing "M-5 M-v" or were you turning the mouse wheel? > Furthermore, I found that reverting the following commit fixes the > issue locally, in a build of emacs-25: > > * 9135bd7..: Paul Eggert 2016-05-13 Improve display of tex-verbatim and Info quoted Yes, but that doesn't help, the problem is not with selecting a different font. > When causing the problematic behavior, redisplay_window reaches > try_to_scroll via this if statement: > > if (!cursor_row_fully_visible_p (w, false, false)) > { > /* Point does appear, but on a line partly visible at end of window. > Move it back to a fully-visible line. */ > new_vpos = window_box_height (w); > /* But if window_box_height suggests a Y coordinate that is > not less than we already have, that line will clearly not > be fully visible, so give up and scroll the display. > This can happen when the default face uses a font whose > dimensions are different from the frame's default > font. */ > if (new_vpos >= w->cursor.y) > { > w->cursor.vpos = -1; > clear_glyph_matrix (w->desired_matrix); > goto try_to_scroll; > } > } > > That is, (!cursor_row_fully_visible_p (w, false, false)) and > (new_vpos >= w->cursor.y) evaluate to true. And what are the values of new_vpos and w->cursor.y in this case? And what is w->cursor.vpos? > try_to_scroll looks like this: I suspect we shouldn't go there in this case. The logic above fails because it thinks we are at end of window, whereas we actually are at or before the beginning of window. > When I execute the same scroll command (from the same point and window > scroll state) in the commit prior to the problematic one, then the if > expression, > > if (!cursor_row_fully_visible_p (w, false, false)) > > evaluates to false instead, control flow leads elsewhere, and the bug > does not happen. Which means that commit is not the culprit, it just exposes some subtle bug. Thanks for digging into this.