From: Eli Zaretskii <eliz@gnu.org>
To: Ari Roponen <ari.roponen@gmail.com>
Cc: 11464@debbugs.gnu.org
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 [thread overview]
Message-ID: <83likqojxl.fsf@gnu.org> (raw)
In-Reply-To: <87pqa3csuc.fsf@gmail.com>
> From: Ari Roponen <ari.roponen@gmail.com>
> 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.
next prev parent reply other threads:[~2012-05-17 16:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-13 15:54 bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text Ari Roponen
2012-05-13 18:26 ` Eli Zaretskii
2012-05-15 10:07 ` Ari Roponen
2012-05-15 16:19 ` Eli Zaretskii
2012-05-16 5:21 ` Ari Roponen
2012-05-16 15:15 ` Eli Zaretskii
2012-05-17 4:52 ` Ari Roponen
2012-05-17 16:23 ` Eli Zaretskii [this message]
2012-05-17 17:54 ` Ari Roponen
2012-05-17 17:56 ` Michael Welsh Duggan
2012-05-17 21:11 ` Eli Zaretskii
2012-05-17 21:22 ` Michael Welsh Duggan
2012-05-18 7:42 ` Eli Zaretskii
2012-05-18 8:03 ` Ari Roponen
2012-05-18 8:26 ` Ari Roponen
2012-05-18 8:44 ` Eli Zaretskii
2012-05-18 10:47 ` Ari Roponen
2012-05-18 11:32 ` Eli Zaretskii
2012-05-18 11:47 ` Ari Roponen
2012-05-18 14:02 ` Eli Zaretskii
2012-05-18 14:39 ` Ari Roponen
2012-05-18 14:59 ` Eli Zaretskii
2012-05-19 12:26 ` Eli Zaretskii
2012-05-19 12:32 ` Ari Roponen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83likqojxl.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=11464@debbugs.gnu.org \
--cc=ari.roponen@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).