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

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Thu, 8 Dec 2022 11:18:01 UTC

Severity: normal

Found in version 30.0.50

Full log


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

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59902 <at> debbugs.gnu.org
Subject: Re: bug#59902: 30.0.50; Image overlay is not updated until the
 cursor moves to the overlay
Date: Thu, 15 Dec 2022 10:24:16 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> > Why was this implementation chosen for whatever feature that produces
>> > images?  Emacs doesn't react instantly to changes in disk files that
>> > it visits, and here you expect it to do so.  Isn't it possible to
>> > implement this in some other way, like have the program produce its
>> > image data in a temporary Emacs buffer, then use that buffer's
>> > contents for creating an image?  Then I believe the updated image will
>> > have a different hash value, and there will be no cache-related
>> > collisions.
>> 
>> It could be possible, but looks like unnecessary complication.
>> Also, creating buffers often creates overheads associated with user
>> hooks.
>> 
>> I am not sure if something like
>> 
>> (let ((revert-without-query '(".")))
>> 		      (with-current-buffer (find-file-noselect file)
>>                         ;; Do not crown the buffer list.
>>                         (unless (string-prefix-p " " (buffer-name))
>>                           (setf (buffer-name) (concat " " (buffer-name))))
>> 			(buffer-string)))
>> 
>> is not going to cause significant slowdowns.
>
> Sorry, you lost me here: how is the above snippet relevant to what I
> proposed as an alternative implementation?

The above snippet creates a buffer with image FILE, reverts it if
necessary (`find-file-noselect' should do it), and returns the image
data that is guaranteed to be up-to-date with the actual file.

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




This bug report was last modified 2 years and 183 days ago.

Previous Next


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