all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#17942: 24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for the first row only containing a single image
@ 2014-07-04 23:38 YAMAMOTO Mitsuharu
  2014-07-05  7:39 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2014-07-04 23:38 UTC (permalink / raw)
  To: 17942

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@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@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'





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#17942: 24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for the first row only containing a single image
  2014-07-04 23:38 bug#17942: 24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for the first row only containing a single image YAMAMOTO Mitsuharu
@ 2014-07-05  7:39 ` Eli Zaretskii
  2014-07-05  8:00   ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2014-07-05  7:39 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: 17942-done

> 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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#17942: 24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for the first row only containing a single image
  2014-07-05  7:39 ` Eli Zaretskii
@ 2014-07-05  8:00   ` YAMAMOTO Mitsuharu
  2014-07-05  8:25     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2014-07-05  8:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 17942-done

>>>>> 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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#17942: 24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for the first row only containing a single image
  2014-07-05  8:00   ` YAMAMOTO Mitsuharu
@ 2014-07-05  8:25     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2014-07-05  8:25 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: 17942

> Date: Sat, 05 Jul 2014 17:00:40 +0900
> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> Cc: 17942-done@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-05  8:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04 23:38 bug#17942: 24.3.92; pos-visible-in-window-p with PARTIALLY is wrong for the first row only containing a single image YAMAMOTO Mitsuharu
2014-07-05  7:39 ` Eli Zaretskii
2014-07-05  8:00   ` YAMAMOTO Mitsuharu
2014-07-05  8:25     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.