unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: How to find out whether an image is displayed anywhere?
Date: Mon, 04 Jul 2011 15:15:54 -0400	[thread overview]
Message-ID: <jwvaact6ety.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3hb77qhuc.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Thu, 30 Jun 2011 20:44:59 +0200")

>> 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	other threads:[~2011-07-04 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-26 15:49 How to find out whether an image is displayed anywhere? Lars Magne Ingebrigtsen
2011-06-26 20:45 ` Chong Yidong
2011-06-26 21:08   ` Lars Magne Ingebrigtsen
2011-06-30 16:34 ` Stefan Monnier
2011-06-30 18:44   ` Lars Magne Ingebrigtsen
2011-07-04 19:15     ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvaact6ety.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).