From unknown Sat Jun 21 03:17:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#11464 <11464@debbugs.gnu.org> To: bug#11464 <11464@debbugs.gnu.org> Subject: Status: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text Reply-To: bug#11464 <11464@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:17:37 +0000 retitle 11464 24.1.50; pos-visible-in-window-p returns a false positive wit= h bidi text reassign 11464 emacs submitter 11464 Ari Roponen severity 11464 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 13 11:55:54 2012 Received: (at submit) by debbugs.gnu.org; 13 May 2012 15:55:54 +0000 Received: from localhost ([127.0.0.1]:51638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1STb9E-0007qC-Ld for submit@debbugs.gnu.org; Sun, 13 May 2012 11:55:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49275) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1STb8t-0007pi-Hx for submit@debbugs.gnu.org; Sun, 13 May 2012 11:55:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1STb8W-0008O8-3f for submit@debbugs.gnu.org; Sun, 13 May 2012 11:55:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STb8V-0008Nl-UB for submit@debbugs.gnu.org; Sun, 13 May 2012 11:55:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STb8U-0005pk-9r for bug-gnu-emacs@gnu.org; Sun, 13 May 2012 11:55:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1STb8S-0008KO-C1 for bug-gnu-emacs@gnu.org; Sun, 13 May 2012 11:55:05 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:52994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STb8R-0008DJ-Uv for bug-gnu-emacs@gnu.org; Sun, 13 May 2012 11:55:04 -0400 Received: by lbjn8 with SMTP id n8so3428781lbj.0 for ; Sun, 13 May 2012 08:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=X/JblxJsnKDAHBIfFKNt6sXeJOY6RQ2+wGsVw6WQKRQ=; b=Lt8DLRA3USy7SmILEUU07Fx4UhBflqGy04pdztB2lEm69yHPE1gDXzsaTvCHOmHVNN Us0L55mgxlG1z9t4mwsP0wTngwr3tJlVhIuDBktdUbA2jBfBwZJQ/EVQn7GhCrVUHHDt 023oeahurqaf3k9aU4ZeXlF5Smta8aec/tzfQQMyXqdSqjWuL0GgWHnVBCc/4ATvOCFw Bpepd7R0HrQ41ogi49CnDRpvY34C65/D26v+9PUsR5SQcEwsg+Gcy1rKCRpy5mKR6kO1 a6TYdKiSU/sg0eekjkjwFMmdCS1XzwPxj9HFj6tHTUw8ZjS8rHlmgWjCG/srskfksPBe HZCA== Received: by 10.152.148.199 with SMTP id tu7mr5094803lab.43.1336924500849; Sun, 13 May 2012 08:55:00 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id u4sm16491324lad.5.2012.05.13.08.54.59 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 May 2012 08:55:00 -0700 (PDT) From: Ari Roponen To: bug-gnu-emacs@gnu.org Subject: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text Date: Sun, 13 May 2012 18:54:59 +0300 Message-ID: <87y5owjcto.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) The following code shows a problem with pos-visible-in-window-p and bidirectional text. When there are right-to-left characters at the beginning of the buffer, the function returns nil, as the last line is not visible. However, when "a" is inserted into the beginning of the buffer, the function returns t, which is incorrect. The bug happens in trunk and emacs-24, but not in emacs-23, so it could be considered as a regression ;-) (let (before after) (pop-to-buffer (get-buffer-create "test")) (erase-buffer) (dotimes (i (* 2 (window-height))) (insert "\u05d0\n")) ; HEBREW LETTER ALEF (insert "Last line\n") (goto-char (point-min)) (setq before (pos-visible-in-window-p (point-max))) (insert "a") (setq after (pos-visible-in-window-p (point-max))) (message "Visible: before: %S, after: %S" before after)) In GNU Emacs 24.1.50.8 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.1) of 2012-05-13 on arirop Bzr revision: 108213 monnier@iro.umontreal.ca-20120513030506-t7ggxqlr92y8yjw4 Windowing system distributor `Fedora Project', version 11.0.11200000 Configured using: `configure '--with-x-toolkit=gtk3'' -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Sun May 13 14:24:58 2012 Received: (at 11464-done) by debbugs.gnu.org; 13 May 2012 18:24:58 +0000 Received: from localhost ([127.0.0.1]:51691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1STdTW-0002uG-5d for submit@debbugs.gnu.org; Sun, 13 May 2012 14:24:58 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:53765) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1STdTB-0002tk-Uw for 11464-done@debbugs.gnu.org; Sun, 13 May 2012 14:24:57 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M3Z003004CRR400@a-mtaout21.012.net.il> for 11464-done@debbugs.gnu.org; Sun, 13 May 2012 21:23:56 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M3Z003WO4FVOO50@a-mtaout21.012.net.il>; Sun, 13 May 2012 21:23:55 +0300 (IDT) Date: Sun, 13 May 2012 21:26:03 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <87y5owjcto.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83pqa8vsxw.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464-done Cc: 11464-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Ari Roponen > Date: Sun, 13 May 2012 18:54:59 +0300 > > The following code shows a problem with pos-visible-in-window-p > and bidirectional text. When there are right-to-left characters > at the beginning of the buffer, the function returns nil, as the > last line is not visible. However, when "a" is inserted into the > beginning of the buffer, the function returns t, which is > incorrect. Sigh... where are you guys on weekends, when I _really_ have time to work on Emacs?... > The bug happens in trunk and emacs-24, but not in emacs-23, so it > could be considered as a regression ;-) Nothing that's related to R2L text in a left-to-right paragraph can ever be a regression wrt Emacs 23. But since the fix is quite simple, here you go: fixed in revision 107994 on the emacs-24 branch. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue May 15 06:07:35 2012 Received: (at 11464) by debbugs.gnu.org; 15 May 2012 10:07:35 +0000 Received: from localhost ([127.0.0.1]:55356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUEfG-0004Tl-PI for submit@debbugs.gnu.org; Tue, 15 May 2012 06:07:35 -0400 Received: from mail-lpp01m010-f44.google.com ([209.85.215.44]:36575) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUEfE-0004TZ-FZ for 11464@debbugs.gnu.org; Tue, 15 May 2012 06:07:33 -0400 Received: by lagv3 with SMTP id v3so2616035lag.3 for <11464@debbugs.gnu.org>; Tue, 15 May 2012 03:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=9h9/mQIcPPCeM/jDhjyk9iAj9UJiNV6zDM9VQ8cy+w4=; b=S4jRiI8XGoU2DCyS8YsEF4+WXDKAEXGXwc9ylPZ3jLxzKwkPYXMwqeD6LxiM9HeIEn QtbjdR4QO8EMR8IYYIyhAVtAJHlbWuJGO64CvptaaWzDR4QYhMERA41iinQweoyjJRQI XiyGnvmAN5+JxVig2KAiGS6N1ryP+S/CvA8P7hTW2zjotQnbpgWKSdzizH9iK0IATsMM Q33Fj93rRhjDJJEHP0R9UPmPXvZV6yG9rv/aT+WsL1GxOFKSXSIQtuijQKyWcp/o779x 5s0bzuLNnPiMnkODAM3Htnlee5eSYTEKKVbCr1mZ/h9HFPUnBY7IkxZUJ/SFF/SZWMtr dIlA== Received: by 10.152.109.198 with SMTP id hu6mr12504223lab.21.1337076441693; Tue, 15 May 2012 03:07:21 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id k4sm27906594lbb.12.2012.05.15.03.07.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 May 2012 03:07:20 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> Date: Tue, 15 May 2012 13:07:08 +0300 In-Reply-To: <83pqa8vsxw.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 13 May 2012 21:26:03 +0300") Message-ID: <87fwb1dagj.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: > > But since the fix is quite simple, here you go: fixed in revision > 107994 on the emacs-24 branch. > Thank you. I can still reproduce the bug with that revision, but the following tweak seems to help. I'm not sure if it is correct, but at least it fixes the testcase, and everything else seems to work okay. === modified file 'src/xdisp.c' --- src/xdisp.c 2012-05-13 18:22:35 +0000 +++ src/xdisp.c 2012-05-15 09:51:45 +0000 @@ -1313,7 +1313,7 @@ visible_p = bottom_y > window_top_y; else if (top_y < it.last_visible_y) visible_p = 1; - if (bottom_y >= it.last_visible_y + if (bottom_y <= it.last_visible_y && it.bidi_p && it.bidi_it.scan_dir == -1 && IT_CHARPOS (it) < charpos) { -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Tue May 15 12:18:41 2012 Received: (at 11464) by debbugs.gnu.org; 15 May 2012 16:18:41 +0000 Received: from localhost ([127.0.0.1]:56295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUKSO-00076o-Ub for submit@debbugs.gnu.org; Tue, 15 May 2012 12:18:41 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:39431) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUKSM-00076Z-MO for 11464@debbugs.gnu.org; Tue, 15 May 2012 12:18:39 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M4200J00NR96J00@a-mtaout22.012.net.il> for 11464@debbugs.gnu.org; Tue, 15 May 2012 19:17:40 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4200I8VNXF13I0@a-mtaout22.012.net.il>; Tue, 15 May 2012 19:17:40 +0300 (IDT) Date: Tue, 15 May 2012 19:19:52 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <87fwb1dagj.fsf_-_@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83wr4do1qv.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Ari Roponen > Cc: 11464@debbugs.gnu.org > Date: Tue, 15 May 2012 13:07:08 +0300 > > Eli Zaretskii writes: > > > > > But since the fix is quite simple, here you go: fixed in revision > > 107994 on the emacs-24 branch. > > > > Thank you. I can still reproduce the bug with that revision, but the > following tweak seems to help. I'm not sure if it is correct, but at > least it fixes the testcase, and everything else seems to work okay. > > === modified file 'src/xdisp.c' > --- src/xdisp.c 2012-05-13 18:22:35 +0000 > +++ src/xdisp.c 2012-05-15 09:51:45 +0000 > @@ -1313,7 +1313,7 @@ > visible_p = bottom_y > window_top_y; > else if (top_y < it.last_visible_y) > visible_p = 1; > - if (bottom_y >= it.last_visible_y > + if (bottom_y <= it.last_visible_y > && it.bidi_p && it.bidi_it.scan_dir == -1 > && IT_CHARPOS (it) < charpos) > { Interesting. What are the values of bottom_y and it.last_visible_y that you see? I only see strict equality in that condition, so both variants work for me. Anyway, I installed the change you suggested, thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed May 16 01:22:33 2012 Received: (at 11464) by debbugs.gnu.org; 16 May 2012 05:22:33 +0000 Received: from localhost ([127.0.0.1]:56926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUWgy-0002vb-S1 for submit@debbugs.gnu.org; Wed, 16 May 2012 01:22:33 -0400 Received: from mail-lpp01m010-f44.google.com ([209.85.215.44]:55992) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUWge-0002v3-HQ for 11464@debbugs.gnu.org; Wed, 16 May 2012 01:22:31 -0400 Received: by lagv3 with SMTP id v3so220840lag.3 for <11464@debbugs.gnu.org>; Tue, 15 May 2012 22:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=5sP2Zt0X6U2NAYBQSVyy9+qGAA/52gp6L6mI3PTBy4A=; b=i1eKVc2Za9wBiQDMim9uQDUi/EdBPSgxCUSxDkwxw1y9xnzX4MM+BTmxuLXcQpGIJR hZuYP7Wls6OmaYVU33jyKYFwR5Kkb5N4WOSNgTbnkG5vKCBt0Q0264BjpQAB2XFIL+kp 917QZ38pgwnUDipupQYr09fbvwHZbbPEss5F7NclbSuVsw5ZrxxvFv+cdQhU2GCNMtBX UoB6SJFcL5hQz1IIdckwnG25VL64awkKRXdZ5gR+MkasVriZTlPYW1CVMod9in2cDdr9 4Y/9z8DwlZuISAXzikJRLA46dTekdBMVQgud4xEBbhOAqGTjBXoZJnvsA2YeZ7mOSKhe peug== Received: by 10.112.29.131 with SMTP id k3mr681948lbh.53.1337145718400; Tue, 15 May 2012 22:21:58 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id gw17sm1942521lab.11.2012.05.15.22.21.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 May 2012 22:21:57 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> Date: Wed, 16 May 2012 08:21:54 +0300 In-Reply-To: <83wr4do1qv.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 15 May 2012 19:19:52 +0300") Message-ID: <87bolor98t.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: > Interesting. What are the values of bottom_y and it.last_visible_y > that you see? I only see strict equality in that condition, so both > variants work for me. Tested with emacs-24 revision 107999: bottom_y = 300 it.last_visible_y = 304 I also tested with two other cases and got different values. With "emacs -nw" I got these values: bottom_y = 10 it.last_visible_y = 10 With "emacs -fn fixed" I got these values: bottom_y = 270 it.last_visible_y = 256 The bug doesn't show up in any of these cases. -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Wed May 16 11:14:51 2012 Received: (at 11464) by debbugs.gnu.org; 16 May 2012 15:14:52 +0000 Received: from localhost ([127.0.0.1]:57868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUfwB-0002Oi-Om for submit@debbugs.gnu.org; Wed, 16 May 2012 11:14:51 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:44678) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUfvr-0002O0-Ve for 11464@debbugs.gnu.org; Wed, 16 May 2012 11:14:51 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M4400D00FH6CY00@a-mtaout22.012.net.il> for 11464@debbugs.gnu.org; Wed, 16 May 2012 18:13:43 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4400CP3FMU86I0@a-mtaout22.012.net.il>; Wed, 16 May 2012 18:13:43 +0300 (IDT) Date: Wed, 16 May 2012 18:15:58 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <87bolor98t.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83sjf0nolt.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Ari Roponen > Cc: 11464@debbugs.gnu.org > Date: Wed, 16 May 2012 08:21:54 +0300 > > Tested with emacs-24 revision 107999: > > bottom_y = 300 > it.last_visible_y = 304 > > I also tested with two other cases and got different values. > > With "emacs -nw" I got these values: > > bottom_y = 10 > it.last_visible_y = 10 > > With "emacs -fn fixed" I got these values: > > bottom_y = 270 > it.last_visible_y = 256 Thanks. For my education: In that last case with "-fn fixed", what is the value of top_y and window_top_y to go with bottom_y = 270? From debbugs-submit-bounces@debbugs.gnu.org Thu May 17 00:52:39 2012 Received: (at 11464) by debbugs.gnu.org; 17 May 2012 04:52:39 +0000 Received: from localhost ([127.0.0.1]:58500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUsha-0001K4-Mz for submit@debbugs.gnu.org; Thu, 17 May 2012 00:52:39 -0400 Received: from mail-lpp01m010-f44.google.com ([209.85.215.44]:50049) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUshY-0001Jp-Jg for 11464@debbugs.gnu.org; Thu, 17 May 2012 00:52:37 -0400 Received: by lagv3 with SMTP id v3so986478lag.3 for <11464@debbugs.gnu.org>; Wed, 16 May 2012 21:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=r9ccEh8Xq9z5PsYszcpLFf7/NuCkW7SW3NPtUHJseoA=; b=CBYo9HOR4dLqx7ZYfMDWq4O4gef10lLnEqb5rO1+ZJLKONuxFT8gI55/Tmx5npMC8D w5A+qK1+dW8WzzMm9RATyKNBj4FBoG76m9yjhQS6lO+aaDdGI88kGQaH05T9d97ji42s jbIOh/rKcADdBYlrnvnVEKbHtUaRajGDG54xRcQ/triAggNnBX2AElFGzg4W/NjdtJfV MkcbsT3jwML1Vn5CoqTjc3rxwXEFzno7FAeoU4oU5AKB4PdKayDmqm8pbrf8jP/HCCfe 4kxChCyWheViJeuJIE2uOGawXFlSba+Y+N/m2c2/aZbJ5F1JQ0tvDCARFWgQP1tKwmeG hnQw== Received: by 10.112.43.67 with SMTP id u3mr2517924lbl.16.1337230336973; Wed, 16 May 2012 21:52:16 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id h6sm4687414lbl.13.2012.05.16.21.52.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 May 2012 21:52:16 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> Date: Thu, 17 May 2012 07:52:11 +0300 In-Reply-To: <83sjf0nolt.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 16 May 2012 18:15:58 +0300") Message-ID: <87pqa3csuc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: >> From: Ari Roponen >> >> With "emacs -fn fixed" I got these values: >> >> bottom_y = 270 >> it.last_visible_y = 256 > > Thanks. For my education: In that last case with "-fn fixed", what is > the value of top_y and window_top_y to go with bottom_y = 270? bottom_y = 270 it.last_visible_y = 256 top_y = 255 window_top_y = 0 -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Thu May 17 12:22:54 2012 Received: (at 11464) by debbugs.gnu.org; 17 May 2012 16:22:54 +0000 Received: from localhost ([127.0.0.1]:59495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV3TZ-0001Tk-Om for submit@debbugs.gnu.org; Thu, 17 May 2012 12:22:53 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:45696) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV3TF-0001TD-VL for 11464@debbugs.gnu.org; Thu, 17 May 2012 12:22:53 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M4600A00DATJR00@a-mtaout23.012.net.il> for 11464@debbugs.gnu.org; Thu, 17 May 2012 19:21:33 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4600AAIDFW6OD0@a-mtaout23.012.net.il>; Thu, 17 May 2012 19:21:32 +0300 (IDT) Date: Thu, 17 May 2012 19:23:50 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <87pqa3csuc.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83likqojxl.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Ari Roponen > Cc: 11464@debbugs.gnu.org > Date: Thu, 17 May 2012 07:52:11 +0300 > > bottom_y = 270 > it.last_visible_y = 256 > top_y = 255 > window_top_y = 0 Now I'm totally bewildered. I don't understand how this case is at all relevant to the bug. Please bear with me while I explain what puzzles me, and please point out what I missed. Here's the relevant code fragment: int top_x = it.current_x; int top_y = it.current_y; /* Calling line_bottom_y may change it.method, it.position, etc. */ enum it_method it_method = it.method; int bottom_y = (last_height = 0, line_bottom_y (&it)); int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); if (top_y < window_top_y) visible_p = bottom_y > window_top_y; else if (top_y < it.last_visible_y) visible_p = 1; if (bottom_y <= it.last_visible_y && it.bidi_p && it.bidi_it.scan_dir == -1 && IT_CHARPOS (it) < charpos) { The original problem was that the "else if" clause would incorrectly set visible_p to 1. The "if" clause I added after that, viz.: if (bottom_y <= it.last_visible_y && it.bidi_p && it.bidi_it.scan_dir == -1 && IT_CHARPOS (it) < charpos) attempts to correct that, by eventually resetting visible_p to zero. Now, if bottom_y = 270, it.last_visible_y = 256, and top_y = 255, then the condition in the above "else if" clause is false, and visible_p could not possibly be set to 1. The preceding "if" clause is also false, since window_top_y = 0. Therefore, visible_p should have stayed zero for this situation, and I don't understand why you needed to change if (bottom_y >= it.last_visible_y into if (bottom_y <= it.last_visible_y Can you tell where I'm wrong? Thanks in advance. From debbugs-submit-bounces@debbugs.gnu.org Thu May 17 13:54:50 2012 Received: (at 11464) by debbugs.gnu.org; 17 May 2012 17:54:50 +0000 Received: from localhost ([127.0.0.1]:59584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV4uY-0005FQ-5i for submit@debbugs.gnu.org; Thu, 17 May 2012 13:54:50 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:36704) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV4uE-0005Ek-Db for 11464@debbugs.gnu.org; Thu, 17 May 2012 13:54:49 -0400 Received: by lbbgo11 with SMTP id go11so1423570lbb.3 for <11464@debbugs.gnu.org>; Thu, 17 May 2012 10:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ZPYfWWe8Ldl3w2Ql6Ib84rMGsuPafycNOTYi7X96uVI=; b=e4r8qqFv/bEpM9u/QJiTCRw4btQGKh9TA180nK+gR4/LPrVYVMsdwTm/2BHxzfF3lu 9j3+Dg+QNh7jJTG31r86hQGtYx+dPpqESj87VoBa4//dgERLdjKmUPcaPsPo1kLc4mFz xHB1+BuPS4ORDY0HkZzo9UNOvSrIaA3vGgQcZv0OQdAwAF8KEy6S1h1wXl2t/az/XX/y GiGzcLjPrwfaTE/2myMqKCTugtzltoR+KkL96yLHLKJ0ZlbOKn4vDnyEYVrZmruRsELq iF1ww5AEK/yUqYMuo4rmSazKWlkIcuaWICAX/+L7vSDHyZjT5VyW2xYx0Iw0TCyUpw/g Nt3Q== Received: by 10.112.46.101 with SMTP id u5mr3547258lbm.21.1337277247641; Thu, 17 May 2012 10:54:07 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id ni6sm8726232lab.1.2012.05.17.10.54.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 May 2012 10:54:06 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> Date: Thu, 17 May 2012 20:54:05 +0300 In-Reply-To: <83likqojxl.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 17 May 2012 19:23:50 +0300") Message-ID: <87zk96k81u.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: >> From: Ari Roponen >> Cc: 11464@debbugs.gnu.org >> Date: Thu, 17 May 2012 07:52:11 +0300 >> >> bottom_y = 270 >> it.last_visible_y = 256 >> top_y = 255 >> window_top_y = 0 > > Now I'm totally bewildered. I don't understand how this case is at > all relevant to the bug. Please bear with me while I explain what > puzzles me, and please point out what I missed. Sorry for being unclear. I gave values for three cases, but the bug only happened in two of them. Your patch fixed the second case, my tweak fixed the first case, and the third one (i.e. the one with the above values) worked all the time. -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Thu May 17 13:57:20 2012 Received: (at 11464) by debbugs.gnu.org; 17 May 2012 17:57:20 +0000 Received: from localhost ([127.0.0.1]:59588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV4wx-0005J8-SI for submit@debbugs.gnu.org; Thu, 17 May 2012 13:57:20 -0400 Received: from euclid.red.cert.org ([192.88.209.48]:33234) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV4wv-0005Iw-W6 for 11464@debbugs.gnu.org; Thu, 17 May 2012 13:57:18 -0400 Received: from bucknell.indigo.cert.org (bucknell.indigo.cert.org [10.60.10.121]) by euclid.red.cert.org (8.14.4/8.14.4) with ESMTP id q4HHpecJ003422; Thu, 17 May 2012 13:51:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cert.org; s=jthatj15xw2j; t=1337277100; bh=X9VyzWdcq6G6hmLC/rZmkd8IQ0H+KOqkg6DF2GMrpSU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type:Sender:Reply-To; b=Rn9dgW1/C6N7iG8VBUFIAXRXx5wBF+DjfKP4QL0RAla+JrKmkpcNV9UBhRXVRIYQ3 m0+O+Kf9Ai4djybzAb5utN8jWHHR3DjStZ+vCCAdgLgjv4OpSbwGk74oAaJ5F9hNgc vqkXrTsVcHQZnZnLjzuiEHGhoXuT9kXlTKNWeAYU= Received: from waterbuck.yellow.cert.org (waterbuck.yellow.cert.org [10.20.128.84]) by bucknell.indigo.cert.org (8.14.4/8.14.4/2.81) with ESMTP id q4HHupjA021402; Thu, 17 May 2012 13:56:51 -0400 Received: (from mwd@localhost) by waterbuck.yellow.cert.org (8.14.4/8.14.4/Submit/1.6) id q4HHuj1a008685; Thu, 17 May 2012 13:56:45 -0400 X-Authentication-Warning: waterbuck.yellow.cert.org: mwd set sender to mwd@cert.org using -f From: Michael Welsh Duggan To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> Date: Thu, 17 May 2012 13:56:45 -0400 In-Reply-To: <83likqojxl.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 17 May 2012 19:23:50 +0300") Message-ID: User-Agent: Gnus/5.11002 (No Gnus v0.20) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11464 Cc: Ari Roponen , 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Eli Zaretskii writes: >> From: Ari Roponen >> Cc: 11464@debbugs.gnu.org >> Date: Thu, 17 May 2012 07:52:11 +0300 >> >> bottom_y = 270 >> it.last_visible_y = 256 >> top_y = 255 >> window_top_y = 0 > > Now I'm totally bewildered. I don't understand how this case is at > all relevant to the bug. Please bear with me while I explain what > puzzles me, and please point out what I missed. > > Here's the relevant code fragment: > > int top_x = it.current_x; > int top_y = it.current_y; > /* Calling line_bottom_y may change it.method, it.position, etc. */ > enum it_method it_method = it.method; > int bottom_y = (last_height = 0, line_bottom_y (&it)); > int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); > > if (top_y < window_top_y) > visible_p = bottom_y > window_top_y; > else if (top_y < it.last_visible_y) > visible_p = 1; > if (bottom_y <= it.last_visible_y > && it.bidi_p && it.bidi_it.scan_dir == -1 > && IT_CHARPOS (it) < charpos) > { > > The original problem was that the "else if" clause would incorrectly > set visible_p to 1. The "if" clause I added after that, viz.: > > if (bottom_y <= it.last_visible_y > && it.bidi_p && it.bidi_it.scan_dir == -1 > && IT_CHARPOS (it) < charpos) > > attempts to correct that, by eventually resetting visible_p to zero. > > Now, if bottom_y = 270, it.last_visible_y = 256, and top_y = 255, then > the condition in the above "else if" clause is false, and visible_p > could not possibly be set to 1. Maybe I am misunderstanding, but I think possibly you've been staring at the code too long. if (top_y < window_top_y) ==> if (255 < 0) ==> if (FALSE) else if (top_y < it.last_visible_y) ==> if (255 < 256) ==> if (TRUE) hence, visible_p _would_ be set to 1 by the else if clause. -- Michael Welsh Duggan (mwd@cert.org) From debbugs-submit-bounces@debbugs.gnu.org Thu May 17 17:09:10 2012 Received: (at 11464) by debbugs.gnu.org; 17 May 2012 21:09:10 +0000 Received: from localhost ([127.0.0.1]:59690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV7wc-0001DL-3o for submit@debbugs.gnu.org; Thu, 17 May 2012 17:09:10 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:60574) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV7wa-0001D7-1H for 11464@debbugs.gnu.org; Thu, 17 May 2012 17:09:09 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M4600B00QLSJX00@a-mtaout22.012.net.il> for 11464@debbugs.gnu.org; Fri, 18 May 2012 00:08:44 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4600AR8QQHR0B0@a-mtaout22.012.net.il>; Fri, 18 May 2012 00:08:41 +0300 (IDT) Date: Fri, 18 May 2012 00:11:00 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: X-012-Sender: halo1@inter.net.il To: Michael Welsh Duggan Message-id: <83fwayo6mz.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: ari.roponen@gmail.com, 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Michael Welsh Duggan > Cc: Ari Roponen , 11464@debbugs.gnu.org > Date: Thu, 17 May 2012 13:56:45 -0400 > > else if (top_y < it.last_visible_y) ==> if (255 < 256) ==> if (TRUE) > > hence, visible_p _would_ be set to 1 by the else if clause. And will never be reset to zero, because 27 <= 256 => FALSE. And yet Ari said that he needed to change the condition to <=. From debbugs-submit-bounces@debbugs.gnu.org Thu May 17 17:23:10 2012 Received: (at 11464) by debbugs.gnu.org; 17 May 2012 21:23:10 +0000 Received: from localhost ([127.0.0.1]:59714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV8A9-0001Xo-Ug for submit@debbugs.gnu.org; Thu, 17 May 2012 17:23:10 -0400 Received: from upton.red.cert.org ([192.88.209.60]:49710) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SV8A7-0001XN-Dr for 11464@debbugs.gnu.org; Thu, 17 May 2012 17:23:08 -0400 Received: from bucknell.indigo.cert.org (bucknell.indigo.cert.org [10.60.10.121]) by upton.red.cert.org (8.14.4/8.14.4) with ESMTP id q4HLMfro031755; Thu, 17 May 2012 17:22:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cert.org; s=jthatj15xw2j; t=1337289762; bh=N/kVAV30VRsLGDrY1KgificR5QvHXDwtDAvwGvWZ6Yc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type:Sender:Reply-To; b=CCXWT2xaevB9lCyQNArjLNH/dQmB8brUm+Vai0np1UcI1wKvL3c7c1wE5KnOg2kWx bXJyr0wknfxDMNi66y1yjaWfopO1xKptN4jRDaJEU9k8aD6Wsqjrryyv/341isCLsR PJboe//i2aqsWWRGNs4xOtfv6wtbThL1nHtzNW10= Received: from waterbuck.yellow.cert.org (waterbuck.yellow.cert.org [10.20.128.84]) by bucknell.indigo.cert.org (8.14.4/8.14.4/2.81) with ESMTP id q4HLMfh3003027; Thu, 17 May 2012 17:22:41 -0400 Received: (from mwd@localhost) by waterbuck.yellow.cert.org (8.14.4/8.14.4/Submit/1.6) id q4HLMaEf010501; Thu, 17 May 2012 17:22:36 -0400 X-Authentication-Warning: waterbuck.yellow.cert.org: mwd set sender to mwd@cert.org using -f From: Michael Welsh Duggan To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> Date: Thu, 17 May 2012 17:22:36 -0400 In-Reply-To: <83fwayo6mz.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 May 2012 00:11:00 +0300") Message-ID: User-Agent: Gnus/5.11002 (No Gnus v0.20) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11464 Cc: ari.roponen@gmail.com, 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Eli Zaretskii writes: >> From: Michael Welsh Duggan >> Cc: Ari Roponen , 11464@debbugs.gnu.org >> Date: Thu, 17 May 2012 13:56:45 -0400 >> >> else if (top_y < it.last_visible_y) ==> if (255 < 256) ==> if (TRUE) >> >> hence, visible_p _would_ be set to 1 by the else if clause. > > And will never be reset to zero, because 27 <= 256 => FALSE. And yet > Ari said that he needed to change the condition to <=. But where do you get 27? The number was 270, I believe. >> bottom_y = 270 >> it.last_visible_y = 256 >> top_y = 255 >> window_top_y = 0 -- Michael Welsh Duggan (mwd@cert.org) From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 03:41:32 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 07:41:32 +0000 Received: from localhost ([127.0.0.1]:60087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVHoZ-0000LZ-Kl for submit@debbugs.gnu.org; Fri, 18 May 2012 03:41:32 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:47505) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVHoF-0000L2-Bk for 11464@debbugs.gnu.org; Fri, 18 May 2012 03:41:30 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M4700E00JXIUO00@a-mtaout23.012.net.il> for 11464@debbugs.gnu.org; Fri, 18 May 2012 10:40:15 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4700EEKJZ2MG60@a-mtaout23.012.net.il>; Fri, 18 May 2012 10:40:15 +0300 (IDT) Date: Fri, 18 May 2012 10:42:35 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: X-012-Sender: halo1@inter.net.il To: Michael Welsh Duggan Message-id: <83ehqindec.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: ari.roponen@gmail.com, 11464@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Michael Welsh Duggan > Cc: ari.roponen@gmail.com, 11464@debbugs.gnu.org > Date: Thu, 17 May 2012 17:22:36 -0400 > > Eli Zaretskii writes: > > >> From: Michael Welsh Duggan > >> Cc: Ari Roponen , 11464@debbugs.gnu.org > >> Date: Thu, 17 May 2012 13:56:45 -0400 > >> > >> else if (top_y < it.last_visible_y) ==> if (255 < 256) ==> if (TRUE) > >> > >> hence, visible_p _would_ be set to 1 by the else if clause. > > > > And will never be reset to zero, because 27 <= 256 => FALSE. And yet > > Ari said that he needed to change the condition to <=. > > But where do you get 27? The number was 270, I believe. It's 270, yes. But the rest is correct: if visible_p is set in this case, it will never be reset with the current code. My original code used if (bottom_y >= it.last_visible_y which would have caught this case. Ari, can you please describe again what happens in this particular case on your machine, step by step, when you step with a debugger through the relevant fragment? I'm sorry I keep asking questions, but I must understand what was incorrect in my original reasoning, to make sure there's no subtle bugs lurking here. Also, for this case: > bottom_y = 300 > it.last_visible_y = 304 can you show the corresponding values of top_y and window_top_y? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 04:04:32 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 08:04:32 +0000 Received: from localhost ([127.0.0.1]:60098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVIAp-0001fI-6X for submit@debbugs.gnu.org; Fri, 18 May 2012 04:04:32 -0400 Received: from mail-lpp01m010-f44.google.com ([209.85.215.44]:39552) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVIAj-0001f2-Mi for 11464@debbugs.gnu.org; Fri, 18 May 2012 04:04:30 -0400 Received: by lagv3 with SMTP id v3so1773695lag.3 for <11464@debbugs.gnu.org>; Fri, 18 May 2012 01:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=Je6e8aVSSDYlta/OVmMdHqRZMyYEcnJ745slHbvUeFQ=; b=Ydb661B+dZ9Jxq/LDFC8/lGt2O2U3Fax84PskcqtUse52+P795R/4c5jOFb0m+3Wwm WyHrJx5/rjbReA7Ywp3aSEV2ZWPU3aJ4kfiJMWkJz0q8JR3XajllxjAppRKrx0u4mrvI 38KvHRxuym3vz9SdCsXUpRS/uLM9PlPLm+JYqlQ/iY+FzfmQQLuQ+Of81ERYmGyEwy16 sCkwoUwdPE4lXalK0uEn9TtzxIMKZX7PddLnRE6kLE4OH9Og20Q3ohPBF9s2/879Dipk 8DYd3K1nDEeAZs+73pXEivUSDHD18X7hKBk+Wf9X6Rh1bcpbGMfG0uOShu/VKS7Aq9Jz rhKA== Received: by 10.112.85.200 with SMTP id j8mr4413673lbz.80.1337328239922; Fri, 18 May 2012 01:03:59 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id gw17sm11345145lab.11.2012.05.18.01.03.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 May 2012 01:03:59 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> Date: Fri, 18 May 2012 11:03:52 +0300 In-Reply-To: <83ehqindec.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 May 2012 10:42:35 +0300") Message-ID: <87wr49ex07.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, Michael Welsh Duggan X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: > > It's 270, yes. But the rest is correct: if visible_p is set in this > case, it will never be reset with the current code. My original code > used > > if (bottom_y >= it.last_visible_y > > which would have caught this case. > > Ari, can you please describe again what happens in this particular > case on your machine, step by step, when you step with a debugger > through the relevant fragment? I sent this reply tonight: http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-05/msg00476.html The summary is that the case you are wondering about didn't have the bug at all. I tried to reproduce the bug in all three cases with emacs-24 revision 107933. The first case "emacs -Q" had the bug; "emacs -nw" had the bug; "emacs -fn fixed" didn't have the bug. Then I updated to revision 107934 (your patch). That fixed the "emacs -nw" case. My tweak fixed the "emacs -Q" case. -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 04:27:03 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 08:27:03 +0000 Received: from localhost ([127.0.0.1]:60103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVIWc-00029Q-Ry for submit@debbugs.gnu.org; Fri, 18 May 2012 04:27:03 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:58999) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVIWI-00028f-LE for 11464@debbugs.gnu.org; Fri, 18 May 2012 04:27:01 -0400 Received: by lbbgo11 with SMTP id go11so1800451lbb.3 for <11464@debbugs.gnu.org>; Fri, 18 May 2012 01:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=7Hma7wbx0ybBMJZ0vWqbktNs+IstSBu2xShkm0/dyIg=; b=pHQgiuHoF2mr67NIAeCa1o8zBbPFmMlnJk3NJKT3zRRURV652OFgCsNtHZNkHjTqRn +9D2CDO7f/Vy88M3Z9UjrzHJ0yRZPadzX3moHA00sHmHhrZN6QloUCuJ7FUEDG4UpEtN Dgmj2SW/OhuqynUqd44tSUrMB+DULntzYFZqTPA82XvU8hWHUHAQA/svSK/N4mCVljRR 26pGc0bv8dRVYm3Q4Wxndekf7GYgoaw4rgeZGwcMjoeq9XVmfhL0/Kxg+dxbnu/+ARSC CxAxjgyRwUksYa1eQxyiZrDCX0AsNZ3n30DnQV85GP9W4lzntfGgSnyVnkgmSf6K7NUF uRjA== Received: by 10.112.101.169 with SMTP id fh9mr4595646lbb.18.1337329576861; Fri, 18 May 2012 01:26:16 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id hi14sm11437627lab.4.2012.05.18.01.26.15 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 May 2012 01:26:16 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> Date: Fri, 18 May 2012 11:26:14 +0300 In-Reply-To: <87wr49ex07.fsf@gmail.com> (Ari Roponen's message of "Fri, 18 May 2012 11:03:52 +0300") Message-ID: <87sjexevyx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, Michael Welsh Duggan X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Ari Roponen writes: > I sent this reply tonight: > http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-05/msg00476.html > > The summary is that the case you are wondering about didn't have the bug > at all. > > I tried to reproduce the bug in all three cases with emacs-24 revision > 107933. The first case "emacs -Q" had the bug; "emacs -nw" had the bug; > "emacs -fn fixed" didn't have the bug. > > Then I updated to revision 107934 (your patch). That fixed the "emacs > -nw" case. My tweak fixed the "emacs -Q" case. Of course, I meant revisions 107993 and 107994. And the reply was sent yesterday ;-) -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 04:42:47 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 08:42:47 +0000 Received: from localhost ([127.0.0.1]:60108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVIlr-0002X1-8O for submit@debbugs.gnu.org; Fri, 18 May 2012 04:42:47 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:43447) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVIln-0002Wk-Su for 11464@debbugs.gnu.org; Fri, 18 May 2012 04:42:45 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M4700H00MSUV600@a-mtaout22.012.net.il> for 11464@debbugs.gnu.org; Fri, 18 May 2012 11:42:17 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4700HJ9MUG4YC0@a-mtaout22.012.net.il>; Fri, 18 May 2012 11:42:17 +0300 (IDT) Date: Fri, 18 May 2012 11:44:34 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <87wr49ex07.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83vcjtswst.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Ari Roponen > Cc: Michael Welsh Duggan , 11464@debbugs.gnu.org > Date: Fri, 18 May 2012 11:03:52 +0300 > > Eli Zaretskii writes: > > > > > It's 270, yes. But the rest is correct: if visible_p is set in this > > case, it will never be reset with the current code. My original code > > used > > > > if (bottom_y >= it.last_visible_y > > > > which would have caught this case. > > > > Ari, can you please describe again what happens in this particular > > case on your machine, step by step, when you step with a debugger > > through the relevant fragment? > > I sent this reply tonight: > http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-05/msg00476.html > > The summary is that the case you are wondering about didn't have the bug > at all. Yes, you did say that. But as Michael points out, this fragment else if (top_y < it.last_visible_y) visible_p = 1; should have set visible_p to 1 in your last case, the one where > bottom_y = 270 > it.last_visible_y = 256 > top_y = 255 > window_top_y = 0 And if that happens, the correction code below, viz.: if (bottom_y <= it.last_visible_y && it.bidi_p && it.bidi_it.scan_dir == -1 && IT_CHARPOS (it) < charpos) would evaluate to false, and visible_p would have stayed at its 1 value, which is wrong. So could you please clarify this case? Also, what was the value of top_y in your first case, i.e.: > bottom_y = 300 > it.last_visible_y = 304 Again, sorry for bothering you with the details. I just must understand what is going on here and where did I err in my original change. Thanks! From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 06:47:59 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 10:47:59 +0000 Received: from localhost ([127.0.0.1]:60212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVKj0-0005Ot-H9 for submit@debbugs.gnu.org; Fri, 18 May 2012 06:47:59 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:34704) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVKix-0005Od-JP for 11464@debbugs.gnu.org; Fri, 18 May 2012 06:47:57 -0400 Received: by lbbgo11 with SMTP id go11so1866978lbb.3 for <11464@debbugs.gnu.org>; Fri, 18 May 2012 03:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=Hwj9d89VVbLM9qm1khZBl6ppKa70XB6k//LQycCv4xY=; b=gxcaSqM0oIRuV2chPc2jTSz3o4CodpuB5uUzZ1YetRf7BbSjWcxOOmj8JY83GA8aEA wZr+ZEhnfk8OKRXXo12wSu4L87KJuDuS/oqm+tRdIdnd9k1qkf4rJQ4Kbbd2egNLI/Vy DjUHOTSbZ8qcHOiZ5j/MH+kYZD50TN8XTzJJlzRj19lUUSFNUBfUFjds7lfsa29QoXEj S84Tu3QH6blKT3B6q5PfUZioDkd/3Cki3Y9jB81suFas+8kPnjPt0MSqlavirBbgi+IV gi0MahLUrpSi/opK1KdohJx9JyAVwbfnLdXWHGRZxSGf/W9vIVki3eN8HVPOIfjEWP+A kfhQ== Received: by 10.152.48.37 with SMTP id i5mr4198442lan.36.1337338048887; Fri, 18 May 2012 03:47:28 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id mo3sm11912865lab.2.2012.05.18.03.47.27 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 May 2012 03:47:28 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> <83vcjtswst.fsf@gnu.org> Date: Fri, 18 May 2012 13:47:26 +0300 In-Reply-To: <83vcjtswst.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 May 2012 11:44:34 +0300") Message-ID: <87obplepfl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: > And if that happens, the correction code below, viz.: > > if (bottom_y <= it.last_visible_y > && it.bidi_p && it.bidi_it.scan_dir == -1 > && IT_CHARPOS (it) < charpos) > > would evaluate to false, and visible_p would have stayed at its 1 > value, which is wrong. > > So could you please clarify this case? Yes, pos_visible_p indeed returns incorrect value (1), but it is called from Fpos_visible_in_window_p, which returns the correct value. For longer description, see below. > > Also, what was the value of top_y in your first case, i.e.: > >> bottom_y = 300 >> it.last_visible_y = 304 That case has the following values now (in emacs-24 rev. 108005): bottom_y = 302 it.last_visible_y = 304 top_y = 285 I'm not sure why bottom_y has changed its value. I guess that is because I installed some new fonts. > > Again, sorry for bothering you with the details. I just must > understand what is going on here and where did I err in my original > change. No worries. Here are some logs from my debugging sessions. I don't pretend to know the code, but this shows why the bug didn't happen in the last case ("emacs -fn fixed"). I tried emacs-24 revision 108005, compiled with "-O0 -ggdb". File bug.el contains this: (progn (pop-to-buffer (get-buffer-create "test")) (erase-buffer) (dotimes (i (* 2 (window-height))) (insert "\u05d0\n")) ; HEBREW LETTER ALEF (insert "Last line\n") (goto-char (point-min)) (insert "a") (message "Should be nil: %S" (pos-visible-in-window-p (point-max)))) The function pos_visible_p returns the incorrect value (1): [src]$ gdb --quiet --args ./emacs -Q -fn fixed -l bug.el Reading symbols from /usr/local/repos/bzr/emacs/emacs-24/src/emacs...done. warning: File "/usr/local/repos/bzr/emacs/emacs-24/src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "/usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py". (gdb) source .gdbinit SIGINT is used by the debugger. Are you sure you want to change it? (y or n) [answered Y; input not from terminal] DISPLAY = :0 TERM = xterm Breakpoint 1 at 0x5623fd: file emacs.c, line 394. Temporary breakpoint 2 at 0x588153: file sysdep.c, line 859. (gdb) b xdisp.c:1311 Breakpoint 3 at 0x4311d1: file xdisp.c, line 1311. (gdb) b xdisp.c:1566 Breakpoint 4 at 0x4324d2: file xdisp.c, line 1566. (gdb) r Starting program: /usr/local/repos/bzr/emacs/emacs-24/src/emacs -Q -fn fixed -l bug.el [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7fffe4578700 (LWP 28308)] [New Thread 0x7fffe3d77700 (LWP 28309)] Breakpoint 3, pos_visible_p (w=0x13dbd90, charpos=80, x=0x7fffffffb78c, y= 0x7fffffffb788, rtop=0x7fffffffb79c, rbot=0x7fffffffb798, rowh= 0x7fffffffb794, vpos=0x7fffffffb790) at xdisp.c:1312 1312 if (top_y < window_top_y) Missing separate debuginfos, use: debuginfo-install [...] (gdb) p visible_p $1 = 0 (gdb) n 1314 else if (top_y < it.last_visible_y) (gdb) 1315 visible_p = 1; (gdb) 1316 if (bottom_y <= it.last_visible_y (gdb) 1341 if (visible_p) (gdb) p visible_p $2 = 1 (gdb) c Continuing. Breakpoint 4, pos_visible_p (w=0x13dbd90, charpos=80, x=0x7fffffffb78c, y= 0x7fffffffb788, rtop=0x7fffffffb79c, rbot=0x7fffffffb798, rowh= 0x7fffffffb794, vpos=0x7fffffffb790) at xdisp.c:1566 1566 return visible_p; (gdb) p visible_p $3 = 1 (gdb) The reason the test case works is that the function Fpos_visible_in_window_p contains this: /* If position is above window start or outside buffer boundaries, or if window start is out of range, position is not visible. */ if ((EQ (pos, Qt) || (posint >= CHARPOS (top) && posint <= BUF_ZV (buf))) && CHARPOS (top) >= BUF_BEGV (buf) && CHARPOS (top) <= BUF_ZV (buf) && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos) && (fully_p = !rtop && !rbot, (!NILP (partially) || fully_p))) in_window = Qt; Here pos_visible_p returns 1, but the next condition evaluates to false, since (!NILP (partially) || fully_p) is false. [src]$ gdb --quiet --args ./emacs -Q -fn fixed -l bug.el Reading symbols from /usr/local/repos/bzr/emacs/emacs-24/src/emacs...done. warning: File "/usr/local/repos/bzr/emacs/emacs-24/src/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "/usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py". (gdb) source .gdbinit SIGINT is used by the debugger. Are you sure you want to change it? (y or n) [answered Y; input not from terminal] DISPLAY = :0 TERM = xterm Breakpoint 1 at 0x5623fd: file emacs.c, line 394. Temporary breakpoint 2 at 0x588153: file sysdep.c, line 859. (gdb) b Fpos_visible_in_window_p Breakpoint 3 at 0x48a5db: file window.c, line 1431. (gdb) r Starting program: /usr/local/repos/bzr/emacs/emacs-24/src/emacs -Q -fn fixed -l bug.el [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7fffe4578700 (LWP 28471)] [New Thread 0x7fffe3d77700 (LWP 28472)] Breakpoint 3, Fpos_visible_in_window_p (pos=320, window=12763682, partially= 12763682) at window.c:1431 1431 Lisp_Object in_window = Qnil; Missing separate debuginfos, use: debuginfo-install [..] (gdb) n 1432 int rtop, rbot, rowh, vpos, fully_p = 1; (gdb) 1435 w = decode_window (window); (gdb) 1436 buf = XBUFFER (w->buffer); (gdb) 1437 SET_TEXT_POS_FROM_MARKER (top, w->start); (gdb) 1439 if (EQ (pos, Qt)) (gdb) 1441 else if (!NILP (pos)) (gdb) 1443 CHECK_NUMBER_COERCE_MARKER (pos); (gdb) 1444 posint = XINT (pos); (gdb) 1453 if ((EQ (pos, Qt) (gdb) 1454 || (posint >= CHARPOS (top) && posint <= BUF_ZV (buf))) (gdb) 1455 && CHARPOS (top) >= BUF_BEGV (buf) (gdb) 1456 && CHARPOS (top) <= BUF_ZV (buf) (gdb) 1457 && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos) (gdb) 1458 && (fully_p = !rtop && !rbot, (!NILP (partially) || fully_p))) (gdb) 1461 if (!NILP (in_window) && !NILP (partially)) (gdb) xprintsym in_window "nil"(gdb) p fully_p $1 = 0 (gdb) xprintsym partially "nil"(gdb) n 1471 return in_window; (gdb) -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 07:33:16 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 11:33:16 +0000 Received: from localhost ([127.0.0.1]:60260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVLQp-0007DK-JM for submit@debbugs.gnu.org; Fri, 18 May 2012 07:33:15 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:60864) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVLQX-0007CF-5L for 11464@debbugs.gnu.org; Fri, 18 May 2012 07:32:57 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M4700J00UM4IT00@a-mtaout22.012.net.il> for 11464@debbugs.gnu.org; Fri, 18 May 2012 14:32:29 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4700JHUUQ5FR20@a-mtaout22.012.net.il>; Fri, 18 May 2012 14:32:29 +0300 (IDT) Date: Fri, 18 May 2012 14:32:29 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <87obplepfl.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83sjexsp0y.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> <83vcjtswst.fsf@gnu.org> <87obplepfl.fsf@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Ari Roponen > Cc: mwd@cert.org, 11464@debbugs.gnu.org > Date: Fri, 18 May 2012 13:47:26 +0300 > > Eli Zaretskii writes: > > > And if that happens, the correction code below, viz.: > > > > if (bottom_y <= it.last_visible_y > > && it.bidi_p && it.bidi_it.scan_dir == -1 > > && IT_CHARPOS (it) < charpos) > > > > would evaluate to false, and visible_p would have stayed at its 1 > > value, which is wrong. > > > > So could you please clarify this case? > > Yes, pos_visible_p indeed returns incorrect value (1), but it is called > from Fpos_visible_in_window_p, which returns the correct value. For > longer description, see below. OK, but pos_visible_p is called from other places, and needs to produce a correct result by itself. > > Also, what was the value of top_y in your first case, i.e.: > > > >> bottom_y = 300 > >> it.last_visible_y = 304 > > That case has the following values now (in emacs-24 rev. 108005): > > bottom_y = 302 > it.last_visible_y = 304 > top_y = 285 Very strange, for both 300 and 302. These values seem to imply that the screen line where we wind up spans pixel coordinates [285..302], which means move_it_to didn't get to its goal coordinate 303. What are the values of it.max_ascent and it.max_descent in this case, at the point where the move_it_to call on line 1287 returns? > I'm not sure why bottom_y has changed its value. I guess that is > because I installed some new fonts. That's okay, they both puzzle me alike. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 07:48:15 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 11:48:15 +0000 Received: from localhost ([127.0.0.1]:60271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVLfJ-0007YX-Ov for submit@debbugs.gnu.org; Fri, 18 May 2012 07:48:15 -0400 Received: from mail-lpp01m010-f44.google.com ([209.85.215.44]:63008) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVLey-0007Xd-Qn for 11464@debbugs.gnu.org; Fri, 18 May 2012 07:48:12 -0400 Received: by lagv3 with SMTP id v3so1881182lag.3 for <11464@debbugs.gnu.org>; Fri, 18 May 2012 04:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=aOmAVvI6rJNTHcRaL9XkDSgm7owWTKRB2KfP0dIRpKI=; b=iZYP0s+p2HHVcNCJJ1yLupzPgwMZ5ykR9kkwXydXek3cZen8zTwr9nDs3ZPa/s02Un o3ckxY/+vHvSB7yYK/E6YTJmOogmqtjFXcTo7QGRJ6zeuI3/K25zeLpKmo0nXZfgfY0z 3oPkYzfSuoUw75Zyo4FmfU7DPLnZFWlI166s7JDkkgiBnzcv9rzCHE8ZEU4jM4Qc4hzV BS2Gp226Xln3Di6KWQTyxcmz4V/WgFuqTrYnJ36mwZLqmrTm21I1e1oOTAfWkNAWyzZv F+fvENCjr9VFzrDY6MiJHMR4Hm9XYRyddc7dXH4EcEJaUzH49FPKun59TOc6+LwISBqI iLTA== Received: by 10.152.148.1 with SMTP id to1mr1523627lab.34.1337341645952; Fri, 18 May 2012 04:47:25 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id uc6sm7022947lbb.3.2012.05.18.04.47.25 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 May 2012 04:47:25 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> <83vcjtswst.fsf@gnu.org> <87obplepfl.fsf@gmail.com> <83sjexsp0y.fsf@gnu.org> Date: Fri, 18 May 2012 14:47:23 +0300 In-Reply-To: <83sjexsp0y.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 May 2012 14:32:29 +0300") Message-ID: <87k409emno.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: > Very strange, for both 300 and 302. These values seem to imply that > the screen line where we wind up spans pixel coordinates [285..302], > which means move_it_to didn't get to its goal coordinate 303. > > What are the values of it.max_ascent and it.max_descent in this case, > at the point where the move_it_to call on line 1287 returns? > it.max_ascent = 14 it.max_descent = 3 -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 10:03:11 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 14:03:11 +0000 Received: from localhost ([127.0.0.1]:32799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVNlu-0002PM-Nc for submit@debbugs.gnu.org; Fri, 18 May 2012 10:03:10 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:35044) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVNlr-0002P9-Sw for 11464@debbugs.gnu.org; Fri, 18 May 2012 10:03:08 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M4800L001JTH200@a-mtaout21.012.net.il> for 11464@debbugs.gnu.org; Fri, 18 May 2012 17:02:11 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4800K9U1NNKQT0@a-mtaout21.012.net.il>; Fri, 18 May 2012 17:02:11 +0300 (IDT) Date: Fri, 18 May 2012 17:02:11 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <87k409emno.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83obplsi3g.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> <83vcjtswst.fsf@gnu.org> <87obplepfl.fsf@gmail.com> <83sjexsp0y.fsf@gnu.org> <87k409emno.fsf@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Ari Roponen > Cc: mwd@cert.org, 11464@debbugs.gnu.org > Date: Fri, 18 May 2012 14:47:23 +0300 > > Eli Zaretskii writes: > > > Very strange, for both 300 and 302. These values seem to imply that > > the screen line where we wind up spans pixel coordinates [285..302], > > which means move_it_to didn't get to its goal coordinate 303. > > > > What are the values of it.max_ascent and it.max_descent in this case, > > at the point where the move_it_to call on line 1287 returns? > > > > it.max_ascent = 14 > it.max_descent = 3 Thanks. This is consistent with top_y and bottom_y, but leaves open the question why move_it_to didn't advance one more line. I will try to reproduce this on my system before I bother you with more questions. From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 10:40:23 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 14:40:23 +0000 Received: from localhost ([127.0.0.1]:32843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVOLu-0003Hf-03 for submit@debbugs.gnu.org; Fri, 18 May 2012 10:40:22 -0400 Received: from mail-lpp01m010-f44.google.com ([209.85.215.44]:53357) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVOLr-0003HP-8H for 11464@debbugs.gnu.org; Fri, 18 May 2012 10:40:20 -0400 Received: by lagv3 with SMTP id v3so1998045lag.3 for <11464@debbugs.gnu.org>; Fri, 18 May 2012 07:39:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=0/MqFasEk4Z2iMCr/OWT3YeZm/bpfLyp3+GMqREAShk=; b=GIjptOGHgE0XPY6EIcAuLouJ4LBz9OtO1TqxeKjnyZJ4cMCN78d/2OCbxJdNdgJhHb S4wP+x2cECzY2mHJJHNkV3M+okDNORlPiUG4uWyKesTHRmpeVxXIxFe4Q9YeP9mIT3Nt V0Y2t8ID0vCt2S2HdFmIFVQaa+e0bh/T/s4ESs5ak7spVtEasuXweEAuJy1jwaKedmN6 lsAD0ED8pwvbEfWsPYtyxoq7oKSniDHarkRe/Jx9lYOIyZnI94IIa/6yTGbqNYs8wlwZ npsNOZHcCxvUuUvmnJRmTfHZSGJHdoaH2r6M7/YcgNTycVvsEQ9mvhWQqt1dVYjb8iTo A7JA== Received: by 10.112.28.10 with SMTP id x10mr4955206lbg.41.1337351991994; Fri, 18 May 2012 07:39:51 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id b3sm7233353lbh.6.2012.05.18.07.39.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 May 2012 07:39:51 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> <83vcjtswst.fsf@gnu.org> <87obplepfl.fsf@gmail.com> <83sjexsp0y.fsf@gnu.org> <87k409emno.fsf@gmail.com> <83obplsi3g.fsf@gnu.org> Date: Fri, 18 May 2012 17:39:39 +0300 In-Reply-To: <83obplsi3g.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 May 2012 17:02:11 +0300") Message-ID: <8762btimdw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: > Thanks. This is consistent with top_y and bottom_y, but leaves open > the question why move_it_to didn't advance one more line. I will try > to reproduce this on my system before I bother you with more > questions. In case it helps, I found out this: Using emacs-24 rev. 107994 (your original patch): ./emacs -Q -fn "DejaVu Sans Mono-10" -l bug.el => "Should be nil: nil" ./emacs -Q -fn "DejaVu Sans Mono-12" -l bug.el => "Should be nil: t" In both cases, the latin letters use the given font, and the Hebrew letters are displayed with corresponding "Arimo" font: xft:-unknown-DejaVu Sans Mono-normal-normal-normal-*-16-*-*-*-m-0-iso10646-1 (#x44) xft:-unknown-Arimo-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x9BD) -- Ari Roponen From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 11:00:02 2012 Received: (at 11464) by debbugs.gnu.org; 18 May 2012 15:00:02 +0000 Received: from localhost ([127.0.0.1]:32850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVOew-0003iz-1E for submit@debbugs.gnu.org; Fri, 18 May 2012 11:00:02 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:51603) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVOet-0003iE-7l for 11464@debbugs.gnu.org; Fri, 18 May 2012 11:00:00 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M4800L0043EI600@a-mtaout22.012.net.il> for 11464@debbugs.gnu.org; Fri, 18 May 2012 17:59:31 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4800KCV4B6SAB0@a-mtaout22.012.net.il>; Fri, 18 May 2012 17:59:31 +0300 (IDT) Date: Fri, 18 May 2012 17:59:26 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <8762btimdw.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83sjexzga9.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> <83vcjtswst.fsf@gnu.org> <87obplepfl.fsf@gmail.com> <83sjexsp0y.fsf@gnu.org> <87k409emno.fsf@gmail.com> <83obplsi3g.fsf@gnu.org> <8762btimdw.fsf@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Ari Roponen > Cc: mwd@cert.org, 11464@debbugs.gnu.org > Date: Fri, 18 May 2012 17:39:39 +0300 > > In case it helps, I found out this: > > Using emacs-24 rev. 107994 (your original patch): > > ./emacs -Q -fn "DejaVu Sans Mono-10" -l bug.el > => "Should be nil: nil" > > ./emacs -Q -fn "DejaVu Sans Mono-12" -l bug.el > => "Should be nil: t" > > In both cases, the latin letters use the given font, and the Hebrew > letters are displayed with corresponding "Arimo" font: > > xft:-unknown-DejaVu Sans Mono-normal-normal-normal-*-16-*-*-*-m-0-iso10646-1 (#x44) > xft:-unknown-Arimo-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x9BD) Yes, this helps. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat May 19 08:27:00 2012 Received: (at 11464) by debbugs.gnu.org; 19 May 2012 12:27:01 +0000 Received: from localhost ([127.0.0.1]:33728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVikN-0001Zt-Cc for submit@debbugs.gnu.org; Sat, 19 May 2012 08:27:00 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:42433) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVikK-0001Ze-0Y for 11464@debbugs.gnu.org; Sat, 19 May 2012 08:26:57 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M4900400RT5OU00@a-mtaout21.012.net.il> for 11464@debbugs.gnu.org; Sat, 19 May 2012 15:26:22 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M49004QTRVYNU20@a-mtaout21.012.net.il>; Sat, 19 May 2012 15:26:22 +0300 (IDT) Date: Sat, 19 May 2012 15:26:24 +0300 From: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text In-reply-to: <8762btimdw.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Ari Roponen Message-id: <83k408z79r.fsf@gnu.org> References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> <83vcjtswst.fsf@gnu.org> <87obplepfl.fsf@gmail.com> <83sjexsp0y.fsf@gnu.org> <87k409emno.fsf@gmail.com> <83obplsi3g.fsf@gnu.org> <8762btimdw.fsf@gmail.com> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, > RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=ham version=3.3.2 > From: Ari Roponen > Cc: mwd@cert.org, 11464@debbugs.gnu.org > Date: Fri, 18 May 2012 17:39:39 +0300 > > Eli Zaretskii writes: > > > Thanks. This is consistent with top_y and bottom_y, but leaves open > > the question why move_it_to didn't advance one more line. I will try > > to reproduce this on my system before I bother you with more > > questions. > > In case it helps, I found out this: > > Using emacs-24 rev. 107994 (your original patch): > > ./emacs -Q -fn "DejaVu Sans Mono-10" -l bug.el > => "Should be nil: nil" > > ./emacs -Q -fn "DejaVu Sans Mono-12" -l bug.el > => "Should be nil: t" > > In both cases, the latin letters use the given font, and the Hebrew > letters are displayed with corresponding "Arimo" font: > > xft:-unknown-DejaVu Sans Mono-normal-normal-normal-*-16-*-*-*-m-0-iso10646-1 (#x44) > xft:-unknown-Arimo-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x9BD) I couldn't find an Arimo font that supports Hebrew. However, I found several fonts already installed on my system with which I could reproduce all of your 3 cases. It turned out there was a subtle misfeature in move_it_to, which pos_visible_p calls, that would produce a situation where bottom_y computed in pos_visible_p could be less that it.last_visible_y. That misfeature caused the computation of bottom_y produce inaccurate result. By fixing that misfeature (see below), I was able to revert the comparison against bottom_y to what it originally was, and get correct results from pos_visible_p in all the cases I tried. In general, if move_it_to stops at the bottom of the window, the last line's bottom_y cannot be less than last_visible_y, because that means there's one more line (partially) visible in the window. So the comparison I originally installed is the correct one. I installed the patch below as revision 108008 on the emacs-24 branch. Please test. Ari and Michael, many thanks for your help in working on this tricky problem. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-15 16:17:42 +0000 +++ src/ChangeLog 2012-05-19 12:14:11 +0000 @@ -1,3 +1,13 @@ +2012-05-19 Eli Zaretskii + + * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator + state after an additional call to move_it_in_display_line_to, keep + the values of it->max_ascent and it->max_descent found for the + entire line. + (pos_visible_p): Revert the comparison against bottom_y to what it + was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb. + (Bug#11464) + 2012-05-15 Eli Zaretskii * xdisp.c (pos_visible_p): Fix last change. (Bug#11464) === modified file 'src/xdisp.c' --- src/xdisp.c 2012-05-15 16:17:42 +0000 +++ src/xdisp.c 2012-05-19 12:14:11 +0000 @@ -1313,7 +1313,7 @@ pos_visible_p (struct window *w, EMACS_I visible_p = bottom_y > window_top_y; else if (top_y < it.last_visible_y) visible_p = 1; - if (bottom_y <= it.last_visible_y + if (bottom_y >= it.last_visible_y && it.bidi_p && it.bidi_it.scan_dir == -1 && IT_CHARPOS (it) < charpos) { @@ -8689,8 +8689,18 @@ move_it_to (struct it *it, EMACS_INT to_ { /* If TO_Y is in this line and TO_X was reached above, we scanned too far. We have to restore - IT's settings to the ones before skipping. */ + IT's settings to the ones before skipping. But + keep the more accurate values of max_ascent and + max_descent we've found while skipping the rest + of the line, for the sake of callers, such as + pos_visible_p, that need to know the line + height. */ + int max_ascent = it->max_ascent; + int max_descent = it->max_descent; + RESTORE_IT (it, &it_backup, backup_data); + it->max_ascent = max_ascent; + it->max_descent = max_descent; reached = 6; } else From debbugs-submit-bounces@debbugs.gnu.org Sat May 19 08:33:10 2012 Received: (at 11464) by debbugs.gnu.org; 19 May 2012 12:33:10 +0000 Received: from localhost ([127.0.0.1]:33733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SViqL-0001jc-CB for submit@debbugs.gnu.org; Sat, 19 May 2012 08:33:10 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:41687) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SViq0-0001im-0u for 11464@debbugs.gnu.org; Sat, 19 May 2012 08:33:07 -0400 Received: by lbbgo11 with SMTP id go11so2494276lbb.3 for <11464@debbugs.gnu.org>; Sat, 19 May 2012 05:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=apVgkIgTrlF07sVPvLOnakI1+wDttCNiu7xavb5InAA=; b=tw23DpaOL2nFRULln97RFh9dwpm8xYdyNxh+nMvqGSIJ288icg4B0KilJzVLbRyUj8 HlBkXmFKmtyEc3/D9twVMJ8QVl0uWEtJzmESWQ0DVPk9yWUNNuHySwzGh+Xctlecqjrh pHfht5+c5WpKUnWgjakPiyC6pOobf086ZmP7T//7tqUxJqhRoSo7uMOpmLgKPy8k6yG8 HFF7vj4iq+GHGL8P/hFC/2oyrM4JGsVO4WnVUqVNex78ycNjJ7OOCAM77LcjsqvBuALm wTYsmBjzZkR6dtMyHIKmc6KK74f2pV97pvtDTpP2AxB6jGvePTeaIv/acDFfVleRBs19 Y2pg== Received: by 10.152.112.233 with SMTP id it9mr4266783lab.40.1337430735477; Sat, 19 May 2012 05:32:15 -0700 (PDT) Received: from arirop (dsl-jklbrasgw1-fe82df00-79.dhcp.inet.fi. [80.223.130.79]) by mx.google.com with ESMTPS id b3sm8740989lbh.6.2012.05.19.05.32.14 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 19 May 2012 05:32:14 -0700 (PDT) From: Ari Roponen To: Eli Zaretskii Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text References: <87y5owjcto.fsf@gmail.com> <83pqa8vsxw.fsf@gnu.org> <87fwb1dagj.fsf_-_@gmail.com> <83wr4do1qv.fsf@gnu.org> <87bolor98t.fsf@gmail.com> <83sjf0nolt.fsf@gnu.org> <87pqa3csuc.fsf@gmail.com> <83likqojxl.fsf@gnu.org> <83fwayo6mz.fsf@gnu.org> <83ehqindec.fsf@gnu.org> <87wr49ex07.fsf@gmail.com> <83vcjtswst.fsf@gnu.org> <87obplepfl.fsf@gmail.com> <83sjexsp0y.fsf@gnu.org> <87k409emno.fsf@gmail.com> <83obplsi3g.fsf@gnu.org> <8762btimdw.fsf@gmail.com> <83k408z79r.fsf@gnu.org> Date: Sat, 19 May 2012 15:32:10 +0300 In-Reply-To: <83k408z79r.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 May 2012 15:26:24 +0300") Message-ID: <871umg9ws5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 11464 Cc: 11464@debbugs.gnu.org, mwd@cert.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: > I installed the patch below as revision 108008 on the emacs-24 > branch. Please test. > I just tested this with all the cases I had, and they worked correctly. Thank you very much! -- Ari Roponen From unknown Sat Jun 21 03:17:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 17 Jun 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator