Subject: Re: bug#59902: 30.0.50; Image overlay is not updated until the cursor moves to the overlay

From: Eli Zaretskii <[email-masked]>
Date: Thu, 15 Dec 2022 12:49:08 +0200

> From: Ihor Radchenko <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 15 Dec 2022 10:24:16 +0000
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> 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.

Then why do you think it will cause slowdowns?  Especially if you
call find-file-noselect with its 3rd argument non-nil, as I think you
should anyway?