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: Fri, 18 May 2012 11:44:34 +0300 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1337330579 18213 80.91.229.3 (18 May 2012 08:42:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 May 2012 08:42:59 +0000 (UTC) Cc: 11464@debbugs.gnu.org, mwd@cert.org To: Ari Roponen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 18 10:42:55 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 1SVIlw-00005N-HE for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 May 2012 10:42:52 +0200 Original-Received: from localhost ([::1]:41018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVIlv-0002xY-SH for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 May 2012 04:42:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVIlt-0002xK-LL for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 04:42:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVIln-0006sr-Db for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 04:42:49 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVIln-0006sm-9v for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 04:42:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SVIm6-0002XU-7a for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 04:43: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: Fri, 18 May 2012 08:43: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.13373305679738 (code B ref 11464); Fri, 18 May 2012 08:43:02 +0000 Original-Received: (at 11464) by debbugs.gnu.org; 18 May 2012 08:42:47 +0000 Original-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 Original-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 Original-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) Original-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) In-reply-to: <87wr49ex07.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:60171 Archived-At: > 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!