From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text Date: Thu, 17 May 2012 19:23:50 +0300 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1337271787 20506 80.91.229.3 (17 May 2012 16:23:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 May 2012 16:23:07 +0000 (UTC) Cc: 11464@debbugs.gnu.org To: Ari Roponen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 17 18:23:05 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SV3Ti-0001mK-T4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 May 2012 18:23:03 +0200 Original-Received: from localhost ([::1]:55200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SV3Ti-0001jE-43 for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 May 2012 12:23:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SV3Ta-0001j6-KG for bug-gnu-emacs@gnu.org; Thu, 17 May 2012 12:23:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SV3TS-0003ls-Vo for bug-gnu-emacs@gnu.org; Thu, 17 May 2012 12:22:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SV3TS-0003lf-S2 for bug-gnu-emacs@gnu.org; Thu, 17 May 2012 12:22:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SV3Ti-0001U5-9R for bug-gnu-emacs@gnu.org; Thu, 17 May 2012 12:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 May 2012 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11464 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11464-submit@debbugs.gnu.org id=B11464.13372717745691 (code B ref 11464); Thu, 17 May 2012 16:23:02 +0000 Original-Received: (at 11464) by debbugs.gnu.org; 17 May 2012 16:22:54 +0000 Original-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 Original-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 Original-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) Original-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) In-reply-to: <87pqa3csuc.fsf@gmail.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:60137 Archived-At: > 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.