From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: How to find out whether an image is displayed anywhere? Date: Thu, 30 Jun 2011 12:34:12 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1309457039 4827 80.91.229.12 (30 Jun 2011 18:03:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Jun 2011 18:03:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 30 20:03:56 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QcLal-0005Rm-85 for ged-emacs-devel@m.gmane.org; Thu, 30 Jun 2011 20:03:55 +0200 Original-Received: from localhost ([::1]:58498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcLaj-0001kx-N4 for ged-emacs-devel@m.gmane.org; Thu, 30 Jun 2011 14:03:53 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcKC1-0002EY-70 for emacs-devel@gnu.org; Thu, 30 Jun 2011 12:34:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcKBy-0006Lr-W7 for emacs-devel@gnu.org; Thu, 30 Jun 2011 12:34:16 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:14357 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcKBy-0006Lb-Mx for emacs-devel@gnu.org; Thu, 30 Jun 2011 12:34:14 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEHALOkDE5MCqDH/2dsb2JhbABSmGaOb3iIeL9JhjEEnk6EKw X-IronPort-AV: E=Sophos;i="4.65,451,1304308800"; d="scan'208";a="117767259" Original-Received: from 76-10-160-199.dsl.teksavvy.com (HELO pastel.home) ([76.10.160.199]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 30 Jun 2011 12:34:13 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 3C3BB5912D; Thu, 30 Jun 2011 12:34:12 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sun, 26 Jun 2011 17:49:47 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141257 Archived-At: > Is there a way to query Emacs whether an image is actually displayed > anywhere? I looked through image.el, and I couldn't find anything... There is a way: fontification-functions (aka "jit-lock"). It's a bit round-about, but with enough work it should be possible to use it for that purpose (e.g. use a timer to remove the `fontified' property every N seconds and if it's still nil after an additional M seconds, then turn off animation. 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). Stefan