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 16:25:56 +0200

> From: Ihor Radchenko <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 15 Dec 2022 13:23:58 +0000
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> > You can let-bind them to nil around that snippet, mo?
> >> 
> >> I only know these hooks from reading the code.
> >> How can I make sure that let-binding will reliably work in future Emacs
> >> versions?
> >
> > I don't think I understand the question.  Do you mean we could
> > possibly remove these hooks in future versions?  If not, what do you
> > mean by "reliably"?
> 
> I am mostly afraid about adding new similar hooks in future. I am not
> even sure if my list of executed hooks is complete.

If and when we'll add new hooks and they prove to be an issue in this
context (i.e. will slow down display of images), they should be added
to those disabled.

> Practically, I'd prefer Emacs to provide a macro or extra argument that
> binds all the necessary hooks when opening a file buffer. Maybe,
> something similar to `delay-mode-hooks'.

I don't think this is possible in practice, since only the application
can know which hooks are or aren't needed.