GNU bug report logs - #59902
30.0.50; Image overlay is not updated until the cursor moves to the overlay

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Ihor Radchenko <yantar92@HIDDEN>; dated Thu, 8 Dec 2022 11:18:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 59902 <at> debbugs.gnu.org:


Received: (at 59902) by debbugs.gnu.org; 8 Dec 2022 11:53:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 08 06:53:01 2022
Received: from localhost ([127.0.0.1]:56322 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p3FSX-0005wG-43
	for submit <at> debbugs.gnu.org; Thu, 08 Dec 2022 06:53:01 -0500
Received: from mout01.posteo.de ([185.67.36.65]:44763)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1p3FSU-0005wA-QP
 for 59902 <at> debbugs.gnu.org; Thu, 08 Dec 2022 06:52:59 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 446EC240027
 for <59902 <at> debbugs.gnu.org>; Thu,  8 Dec 2022 12:52:53 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1670500373; bh=cBZpSRyJHAQDcravG3OOMA/0QKpQxUaDtkh3fpOb3z8=;
 h=From:To:Cc:Subject:Date:From;
 b=lFgKzUGTN2IPTDKjFOTmWRIoppCKgBgNuJk0bh7g7YyrWe77low1e3+3+QhsUqkvF
 CoKAs3sNZVyhic/8Zkj9li4e/nGhPHbLAJ4OGqwvcg16KUrozoxfr9lnIvCk6yphh1
 jiustYtyQFs0E3SvIu349y/+/oEgTFKvzho+MV3u935b08EA/xRkTZANBy7a3D+arR
 sVoRSmLfMBvFzC8hHV30uctannQuCEFykaTn0oh6d6RdRLSc1S5Lbyfnrir5Fj7tb9
 Of+qcNFOFI/7mSrb2TShE0W56VdrFyyC7MY2Gir1Qw1DYR5/qcdsByWkxy8EwidWJp
 T739kAbBIEG0A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4NSXb833vvz6tnw;
 Thu,  8 Dec 2022 12:52:52 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#59902: 30.0.50; Image overlay is not updated until the
 cursor moves to the overlay
In-Reply-To: <83h6y62kjp.fsf@HIDDEN>
References: <87zgby87rm.fsf@localhost> <83h6y62kjp.fsf@HIDDEN>
Date: Thu, 08 Dec 2022 11:52:49 +0000
Message-ID: <87ilim863y.fsf@localhost>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 59902
Cc: 59902 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

>> 3. Open the following org file
>>    #+begin_src sh :results graphics file :file /tmp/colour.png
>>    convert -size 300x300 xc:#002b36 /tmp/colour.png
>>    #+end_src
> ...
> Is the "convert" part in step 3 necessary to reproduce this?  If so,
> it's a huge turn-off for me, because I don't have, and won't have,
> ImageMagick installed, or anything similar to it.  So someone else
> will have to investigate this in that case, sorry.

It is not. Anything generating an image of known size will do.
The original report is in
https://list.orgmode.org/87wn7287n2.fsf@localhost/T/#mda89a57883b92c8b48ad6c4aec9e111c131efe92

You can try the following:

#+begin_src sh :results graphics file :file /tmp/colour.png
true
#+end_src

and then change to

#+begin_src sh :results graphics file :file /tmp/colour2.png
true
#+end_src

The images are attached.

>> If I step through the code inserting the image overlays, the wrong (not
>> updated) overlay appears in `org-display-inline-images':
>
> Where is this code through which you are stepping?

`org-display-inline-images'

>>     (let ((ov (make-overlay
>> 	       (org-element-property :begin link)
>> 	       (progn
>> 		 (goto-char
>> 		  (org-element-property :end link))
>> 		 (skip-chars-backward " \t")
>> 		 (point)))))
>>       (overlay-put ov 'display image) ;; <- the updated image is correctly displayed
>>       (overlay-put ov 'face 'default) ;; <- un-updated image is displayed until we move cursor to the overlay
>
> And if you switch the order of the above two lines?

Ain't helping.

> Anyway, it is not reliable to try to deduce what happens when stepping
> through the code if the problem is relied to cursor motion or
> redisplay, because Edebug changes all of that in radical ways.

I use debug-on-entry. Probably not much different though.

> Finally, a stab in the dark: the fact that the problem disappears when
> you move the cursor might mean that a call to 'redisplay' (or some
> other trigger for redisplay to know stuff has changed) is missing
> somewhere.

Nope. When I move the cursor away, the erroneous image is displayed again.


--=-=-=
Content-Type: image/png
Content-Disposition: attachment; filename=colour.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAASwAAAEsAQMAAABDsxw2AAAABGdBTUEAALGPC/xhBQAAACBjSFJN
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAKzb////GiCa1AAAA
AWJLR0QB/wIt3gAAAAd0SU1FB+YMCAszOau2lQgAAAAiSURBVGje7cExAQAAAMKg9U9tCj+gAAAA
AAAAAAAAAAB4GS20AAH/6QlrAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTEyLTA4VDExOjUxOjU3
KzAwOjAwE0fC7wAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0xMi0wOFQxMTo1MTo1NyswMDowMGIa
elMAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjItMTItMDhUMTE6NTE6NTcrMDA6MDA1D1uMAAAA
AElFTkSuQmCC
--=-=-=
Content-Type: image/png
Content-Disposition: attachment; filename=colour2.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAfQAAAEsAQMAAAAPddOLAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUAKzb////GiCa1AAAA
AWJLR0QB/wIt3gAAAAd0SU1FB+YMCAsvAWXDcMsAAAApSURBVHja7cExAQAAAMKg9U9tCy+gAAAA
AAAAAAAAAAAAAAAAAAAA4GdLAAAB9wDA9AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0xMi0wOFQx
MTo0NzowMSswMDowMPTnVjYAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMTItMDhUMTE6NDc6MDEr
MDA6MDCFuu6KAAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDIyLTEyLTA4VDExOjQ3OjAxKzAwOjAw
0q/PVQAAAABJRU5ErkJggg==
--=-=-=
Content-Type: text/plain



-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59902; Package emacs. Full text available.

Message received at 59902 <at> debbugs.gnu.org:


Received: (at 59902) by debbugs.gnu.org; 8 Dec 2022 11:38:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 08 06:38:07 2022
Received: from localhost ([127.0.0.1]:56242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p3FE6-0003HE-Lw
	for submit <at> debbugs.gnu.org; Thu, 08 Dec 2022 06:38:07 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36660)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1p3FE1-0003Gg-8L
 for 59902 <at> debbugs.gnu.org; Thu, 08 Dec 2022 06:38:06 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1p3FDm-0005zX-GZ; Thu, 08 Dec 2022 06:37:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=XgSalqOnx0PBUb50xIPxwhBFA7PTkpjo9Y+JKmefnVI=; b=CiSJhf6eOMRX
 qJgtBfVlJ8iEkJ6CMTsEljLkWcAyflU9Umw3wheMGzFEuo5QqZ1LedlXcKk6jPkg7tTOLstUjwStd
 OzKbi6bflZu06z+B8lpH1PmvI2ncll8sg7ImW7GWWVo+b3s1zr8ujZ3jG19DZoGpTbRmSq04ErT/F
 9mH7zhuZhBuw6BdjgXbkEpMvTwQj0FXcWr6xfxW9GDxTwg/oMozP5i/GI5/8fGgzB2UpINlMrBh64
 T5ALD0SqQvKFADrXCMVM1OeeweWsl3XxnWVX02qDDehAT3UMi4TnkwCgeZLAixU6IKa0DvHkR36v5
 PQCvexd0vvumUE6JHTtHwQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1p3FDg-0002D0-Ie; Thu, 08 Dec 2022 06:37:42 -0500
Date: Thu, 08 Dec 2022 13:37:30 +0200
Message-Id: <83h6y62kjp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87zgby87rm.fsf@localhost> (message from Ihor Radchenko on Thu,
 08 Dec 2022 11:17:01 +0000)
Subject: Re: bug#59902: 30.0.50;
 Image overlay is not updated until the cursor moves to the overlay
References: <87zgby87rm.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59902
Cc: 59902 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Ihor Radchenko <yantar92@HIDDEN>
> Date: Thu, 08 Dec 2022 11:17:01 +0000
> 
> 1. emacs -Q
> 2. M-: (require 'ob-shell)
> 3. Open the following org file
>    #+begin_src sh :results graphics file :file /tmp/colour.png
>    convert -size 300x300 xc:#002b36 /tmp/colour.png
>    #+end_src
> 4. Move point to the source block and C-c C-c yes
> 5. C-c C-x C-v
> 6. Observe the 300x300 image appearing
> 7. Edit the source code to 500x300
> 8. C-c C-c yes
> 9. Image disappears
> 10. C-c C-x C-v
> 11. Observe what appears to be the old 300x300 image
> 12. Move the cursor to the image
> 13. Observe the correct 500x300 appearing while the cursor is on it!!

Is the "convert" part in step 3 necessary to reproduce this?  If so,
it's a huge turn-off for me, because I don't have, and won't have,
ImageMagick installed, or anything similar to it.  So someone else
will have to investigate this in that case, sorry.

> If I step through the code inserting the image overlays, the wrong (not
> updated) overlay appears in `org-display-inline-images':

Where is this code through which you are stepping?

>     (let ((ov (make-overlay
> 	       (org-element-property :begin link)
> 	       (progn
> 		 (goto-char
> 		  (org-element-property :end link))
> 		 (skip-chars-backward " \t")
> 		 (point)))))
>       (overlay-put ov 'display image) ;; <- the updated image is correctly displayed
>       (overlay-put ov 'face 'default) ;; <- un-updated image is displayed until we move cursor to the overlay

And if you switch the order of the above two lines?

Anyway, it is not reliable to try to deduce what happens when stepping
through the code if the problem is relied to cursor motion or
redisplay, because Edebug changes all of that in radical ways.

Finally, a stab in the dark: the fact that the problem disappears when
you move the cursor might mean that a call to 'redisplay' (or some
other trigger for redisplay to know stuff has changed) is missing
somewhere.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59902; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Dec 2022 11:17:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 08 06:17:21 2022
Received: from localhost ([127.0.0.1]:56135 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1p3Eu0-0002oK-JD
	for submit <at> debbugs.gnu.org; Thu, 08 Dec 2022 06:17:20 -0500
Received: from lists.gnu.org ([209.51.188.17]:46568)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1p3Etv-0002oC-4o
 for submit <at> debbugs.gnu.org; Thu, 08 Dec 2022 06:17:18 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1p3Etu-0007ld-KC
 for bug-gnu-emacs@HIDDEN; Thu, 08 Dec 2022 06:17:14 -0500
Received: from mout02.posteo.de ([185.67.36.66])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1p3Ets-0005XH-Kl
 for bug-gnu-emacs@HIDDEN; Thu, 08 Dec 2022 06:17:14 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 9B20B240107
 for <bug-gnu-emacs@HIDDEN>; Thu,  8 Dec 2022 12:17:09 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1670498229; bh=zYKKRoKZgtD33I2yUCGZTdAkkYmBrjKJsDc2dUgvFUI=;
 h=From:To:Subject:Date:From;
 b=CtNvXRFVmm4xWrsp4nGZvuI0ojiaClHmCJHtZ5gqvWj/2SU6bOYg/nNoWoGJQri+h
 Q3TH4e2ruFGb5GXSU4vOIjaViGJbYMKe8R2bA7W+FlUgZKxomVWKWN1uMQihNIz9UX
 cI2mICtlV2YB4qc4pzTgagkdMT+QX1tHtXSFojwm+KlYVGnM1I6qeEArgH81tgaB0V
 TWarWBHkgRncJSMlcObbRu6vTf8E8pm8ycoNh8hlWdU/6oeK6LsTAQl1JiBcTWB9Pc
 WVk33Di9d4GWDLT0bb3W3u3kWowFu4H9oiSlNuThzwDSirQSbwwFFiHt44Ww9dxygR
 +UpHklX3D5+tw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4NSWnt5pM3z6tsZ
 for <bug-gnu-emacs@HIDDEN>; Thu,  8 Dec 2022 12:17:04 +0100 (CET)
From: Ihor Radchenko <yantar92@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; Image overlay is not updated until the cursor moves to the
 overlay
Date: Thu, 08 Dec 2022 11:17:01 +0000
Message-ID: <87zgby87rm.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@HIDDEN;
 helo=mout02.posteo.de
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi,

Consider the following

1. emacs -Q
2. M-: (require 'ob-shell)
3. Open the following org file
   #+begin_src sh :results graphics file :file /tmp/colour.png
   convert -size 300x300 xc:#002b36 /tmp/colour.png
   #+end_src
4. Move point to the source block and C-c C-c yes
5. C-c C-x C-v
6. Observe the 300x300 image appearing
7. Edit the source code to 500x300
8. C-c C-c yes
9. Image disappears
10. C-c C-x C-v
11. Observe what appears to be the old 300x300 image
12. Move the cursor to the image
13. Observe the correct 500x300 appearing while the cursor is on it!!

If I step through the code inserting the image overlays, the wrong (not
updated) overlay appears in `org-display-inline-images':

    (let ((ov (make-overlay
	       (org-element-property :begin link)
	       (progn
		 (goto-char
		  (org-element-property :end link))
		 (skip-chars-backward " \t")
		 (point)))))
      (overlay-put ov 'display image) ;; <- the updated image is correctly displayed
      (overlay-put ov 'face 'default) ;; <- un-updated image is displayed until we move cursor to the overlay
      (overlay-put ov 'org-image-overlay t)


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2022-12-07 built on localhost
Repository revision: f0e118d3f676afe39df29663399d4bbe8f53f208
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Acknowledgement sent to Ihor Radchenko <yantar92@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#59902; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 8 Dec 2022 12:00:02 UTC

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