Subject: bug#11464: closed (Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 13 May 2012 18:25:02 +0000

Your bug report

#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
11464: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11464
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text
From: Eli Zaretskii <[email-masked]>
To: Ari Roponen <[email-masked]>
Cc: [email-masked]
Date: Sun, 13 May 2012 21:26:03 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Ari Roponen <[email-masked]>
> 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.

Subject: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text
From: Ari Roponen <[email-masked]>
To: [email-masked]
Date: Sun, 13 May 2012 18:54:59 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

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 [email-masked]
Windowing system distributor `Fedora Project', version 11.0.11200000
Configured using:
 `configure '--with-x-toolkit=gtk3''

-- 
Ari Roponen