From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44284: 27.1; with some Unicode font, scrolling upward with the mouse wheel actually scrolls downward when the cursor needs repositioning Date: Sat, 31 Oct 2020 09:38:37 +0200 Message-ID: <83r1pe975u.fsf@gnu.org> References: <20201030105228.GB27593@zira.vinc17.org> <838sboar11.fsf@gnu.org> <20201030133336.GC27593@zira.vinc17.org> <83pn4zal89.fsf@gnu.org> <20201030163125.GD27593@zira.vinc17.org> <20201030203453.GF27593@zira.vinc17.org> <20201030205702.GG27593@zira.vinc17.org> <83y2jn8lqr.fsf@gnu.org> <20201030230035.GH27593@zira.vinc17.org> <20201031004617.GI27593@zira.vinc17.org> <20201031011350.GJ27593@zira.vinc17.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19939"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44284@debbugs.gnu.org To: Vincent Lefevre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 31 08:39:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kYlTh-00054D-Pj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Oct 2020 08:39:09 +0100 Original-Received: from localhost ([::1]:46710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYlTg-0002gL-Rt for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Oct 2020 03:39:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYlTa-0002ei-62 for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 03:39:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48920) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYlTZ-0004sK-Sj for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 03:39:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYlTZ-0002SZ-Nj for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 03:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Oct 2020 07:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44284 X-GNU-PR-Package: emacs Original-Received: via spool by 44284-submit@debbugs.gnu.org id=B44284.16041299419453 (code B ref 44284); Sat, 31 Oct 2020 07:39:01 +0000 Original-Received: (at 44284) by debbugs.gnu.org; 31 Oct 2020 07:39:01 +0000 Original-Received: from localhost ([127.0.0.1]:60466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYlTY-0002SK-Tj for submit@debbugs.gnu.org; Sat, 31 Oct 2020 03:39:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYlTW-0002S2-Nn for 44284@debbugs.gnu.org; Sat, 31 Oct 2020 03:38:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34974) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYlTR-0004pZ-9G; Sat, 31 Oct 2020 03:38:53 -0400 Original-Received: from [176.228.60.248] (port=4713 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kYlTQ-0007w6-Nu; Sat, 31 Oct 2020 03:38:53 -0400 In-Reply-To: <20201031011350.GJ27593@zira.vinc17.org> (message from Vincent Lefevre on Sat, 31 Oct 2020 02:13:50 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192243 Archived-At: > Date: Sat, 31 Oct 2020 02:13:50 +0100 > From: Vincent Lefevre > Cc: 44284@debbugs.gnu.org > > In try_cursor_movement, one has: > > if (MATRIX_ROW_BOTTOM_Y (row) > last_y > || PT > MATRIX_ROW_END_CHARPOS (row) > /* Line is completely visible last line in window > and PT is to be set in the next line. */ > || (MATRIX_ROW_BOTTOM_Y (row) == last_y > && PT == MATRIX_ROW_END_CHARPOS (row) > && !row->ends_at_zv_p > && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))) > > With the culprit font, MATRIX_ROW_BOTTOM_Y (row) > last_y becomes 1 > when the cursor reaches the last line. With a working font, the value > is still 0. > > More precisely, with size 13, MATRIX_ROW_BOTTOM_Y (row) and last_y are: > > 27 442 > 40 442 > 53 442 > ... > 417 442 > 430 442 > 443 442 <-- line 34 (last visible line) > > and with size 14: > > 28 476 > 42 476 > 56 476 > ... > 448 476 > 462 476 > 476 476 <-- line 34 (last visible line) > > The issue with size 13 is that MATRIX_ROW_BOTTOM_Y (row) is 13*n+1 > instead of 13*n. Thanks. What you describe sounds normal to me: this code is designed to detect these situations. So I see no bug here, at least not yet. I think the issue might be elsewhere: in the code that decides to scroll such that this particular screen line ends up being the last one, and/or that point should be on this last line. If this happens, we will always recenter or move point off that screen line. So the right place to look could be in the scrolling code, probably in window_scroll_pixel_based.