emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to find out whether an image is displayed anywhere?


From: Stefan Monnier
Subject: Re: How to find out whether an image is displayed anywhere?
Date: Mon, 04 Jul 2011 15:15:54 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> Or maybe better: after the animation timer fires don't
>> change the image yet but instead only remove the fontified property and
>> then change the image from fontification-functions).

> I'm not familiar (at all) with the jit-lock functions, but if you think
> that's possible, I'm all for it.  :-)  But I'm not the person to
> implement something like that.

> It sounds like it could be kept nicely local to image.el, though, so the
> users of the animated pictures don't have to care.

Indeed.  It would look something like:

- change the code that updates the image so that instead of actually
  updating the image, it just sets a `image-upon-redisplay-function'
  text-property on the image, whose value is a function that actually
  updates the image.
- call (jit-lock-register #'image-update-animations) somewhere.
- write image-update-animations which just looks for the
  image-upon-redisplay-function properties in the specified region and
  calls the corresponding function.

There are still some issues with respect to timer management (you may
want not to use a repeating timer but instead to re-arm the timer
manually from the image-upon-redisplay-function).


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]