GNU bug report logs - #17942
24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for the first row only containing a single image

Previous Next

Package: emacs;

Reported by: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Date: Fri, 4 Jul 2014 23:39:01 UTC

Severity: normal

Found in version 24.3.92

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17942 in the body.
You can then email your comments to 17942 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17942; Package emacs. (Fri, 04 Jul 2014 23:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 04 Jul 2014 23:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: 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 08:38:26 +0900
Steps to reproduce:

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.

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp

In GNU Emacs 24.3.92.1 (x86_64-apple-darwin13.2.0, GTK+ Version 3.12.2)
 of 2014-07-05 on YAMAMOTO-no-iMac.local
Repository revision: 117350 stephen.berman <at> gmx.net-20140704190929-xpf743kwesgh2k4q
Windowing system distributor `The X.Org Foundation', version 11.0.11406000
Configured using:
 `configure --without-imagemagick LDFLAGS=-L/opt/local/lib
 CPPFLAGS=-I/opt/local/include'




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 05 Jul 2014 07:41:02 GMT) Full text and rfc822 format available.

Notification sent to YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>:
bug acknowledged by developer. (Sat, 05 Jul 2014 07:41:03 GMT) Full text and rfc822 format available.

Message #10 received at 17942-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Cc: 17942-done <at> debbugs.gnu.org
Subject: Re: 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 10:39:59 +0300
> Date: Sat, 05 Jul 2014 08:38:26 +0900
> From: YAMAMOTO Mitsuharu <mituharu <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17942; Package emacs. (Sat, 05 Jul 2014 08:01:02 GMT) Full text and rfc822 format available.

Message #13 received at 17942-done <at> debbugs.gnu.org (full text, mbox):

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 17942-done <at> debbugs.gnu.org
Subject: Re: 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
>>>>> On Sat, 05 Jul 2014 10:39:59 +0300, Eli Zaretskii <eliz <at> gnu.org> said:

>> Date: Sat, 05 Jul 2014 08:38:26 +0900
>> From: YAMAMOTO Mitsuharu <mituharu <at> 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 <at> math.s.chiba-u.ac.jp




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17942; Package emacs. (Sat, 05 Jul 2014 08:26:01 GMT) Full text and rfc822 format available.

Message #16 received at 17942 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Cc: 17942 <at> debbugs.gnu.org
Subject: Re: 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 11:25:23 +0300
> Date: Sat, 05 Jul 2014 17:00:40 +0900
> From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
> Cc: 17942-done <at> debbugs.gnu.org
> 
> > 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.

Fixed again in r117353.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 Aug 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.