bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17942: 24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for


From: YAMAMOTO Mitsuharu
Subject: bug#17942: 24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for the first row only containing a single image
Date: Sat, 05 Jul 2014 17:00:40 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Sat, 05 Jul 2014 10:39:59 +0300, Eli Zaretskii <eliz@gnu.org> said:

>> Date: Sat, 05 Jul 2014 08:38:26 +0900
>> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
>> 
>> 1. $ emacs -Q &
>> 2. Type the following expression and hit C-j in the *scratch* buffer.
>> 
>> (save-excursion
>> (goto-char (point-min))
>> (insert-image (create-image "splash.png"))
>> (insert ?\n))
>> 
>> 3. Ditto.
>> 
>> (pos-visible-in-window-p (point-min) nil t)
>> 
>> Result:
>> 
>> The expected one is (0 0), but the actual one is (608 188).  As far as
>> I tested, this happens at the first row (i.e., (window-start)) only
>> containing a single image.  If you remove (insert ?\n) in the first
>> expression, then the result is (0 0) as expected.

> Fixed in revision 117352 on the emacs-24 branch.

Thanks for the quick fix.  But it still returns a wrong value when an
image is not at the beginning of buffer but located at the first row:

(let ((p (point)))
  (insert-image (create-image "splash.png"))
  (insert ?\n)
  (set-window-start nil p)
  (pos-visible-in-window-p p nil t))

This returns (0 188) instead of (0 0).  If we replace (insert ?\n)
with (insert ?a ?\n), then it returns (0 0) as expected.

                                     YAMAMOTO Mitsuharu
                                mituharu@math.s.chiba-u.ac.jp





reply via email to

[Prev in Thread] Current Thread [Next in Thread]