From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Image cache Date: Sat, 11 Feb 2006 08:21:36 +0900 Message-ID: References: <87bqxjjwii.fsf_-_@jurta.org> <878xsmewfo.fsf-monnier+emacs@gnu.org> <87fymsfj7v.fsf@jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1139615086 25861 80.91.229.6 (10 Feb 2006 23:44:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2006 23:44:46 +0000 (UTC) Cc: Juri Linkov , monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 11 00:44:20 2006 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1F7hcB-0004KZ-00 for ; Sat, 11 Feb 2006 00:23:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F7hc5-0006cq-Hd for ged-emacs-devel@m.gmane.org; Fri, 10 Feb 2006 18:23:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F7haI-0005ZJ-V9 for emacs-devel@gnu.org; Fri, 10 Feb 2006 18:21:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F7ha9-0005WR-E9 for emacs-devel@gnu.org; Fri, 10 Feb 2006 18:21:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F7ha6-0005Uf-8d for emacs-devel@gnu.org; Fri, 10 Feb 2006 18:21:38 -0500 Original-Received: from [66.249.92.207] (helo=uproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F7hdx-0001tX-SP for emacs-devel@gnu.org; Fri, 10 Feb 2006 18:25:38 -0500 Original-Received: by uproxy.gmail.com with SMTP id k40so163158ugc for ; Fri, 10 Feb 2006 15:21:36 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Eu4lCu5G1a2yEITR0BD4/FoFlGZn3lJWkS+5v2aV+/Sro16hbYzvd5dXyxf2CuiqSZGEIQQmwLxr5DK7J/SrLTt9B6+qio9yqs4Es8+8e0XFhc/eE/MHcbDdBE6+ZytyvE7JQtfsiNb6Jxxh3vg2P+Ej3FqfqtbbNZGk0+LCob0= Original-Received: by 10.49.34.18 with SMTP id m18mr3072442nfj; Fri, 10 Feb 2006 15:21:36 -0800 (PST) Original-Received: by 10.48.1.9 with HTTP; Fri, 10 Feb 2006 15:21:36 -0800 (PST) Original-To: rms@gnu.org In-Reply-To: Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50336 Archived-At: On 2/11/06, Richard M. Stallman wrote: > But it is a bug that the image cache doesn't get updated when the ima= ge file > content changes. Is there an easy way to fix it? > > Fixing this would be desirable. One way to do it would > be to store the file's modtime in the image cache. > Then any reference to the cache could stat the file > to see if it has changed, and reload it if necessary. > > That is pretty simple in theory. Is it simple in practice? One certainly doesn't want to do a stat on _every_ reference, as stats can be expensive (and the thumbs package will tend to use lots of images); I think there would have to be some sort of counter/timer, e.g., only stat if more than 30 seconds since the last stat. However as the stat info would give you time information anyway, that should be relatively straightforward. [Maybe the timeout should also be an image parameter (for some uses, e.g. icons in the mode-line, one may not care enough to pay the expense of statting at all); one can also imagine an adaptive timeout, which would stat more often if the file had been noticed to change recently, which might work better for images being updated in the background.] -miles -- Do not taunt Happy Fun Ball.