From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Can I avoid using `clear-image-cache'? Date: Mon, 09 May 2005 08:01:41 +0200 Message-ID: References: <7ewtqcbq17.fsf@ada2.unipv.it> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115618331 24905 80.91.229.2 (9 May 2005 05:58:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 May 2005 05:58:51 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 09 07:58:46 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DV1HT-0001X2-Dp for geh-help-gnu-emacs@m.gmane.org; Mon, 09 May 2005 07:58:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DV1Pj-0007VH-U4 for geh-help-gnu-emacs@m.gmane.org; Mon, 09 May 2005 02:06:48 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-X-Trace: individual.net fefKCaSfHggN5xXRUYNodQHa9F3KuRGNmGIR+7x/zMuzxGMdkG User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:U6c5C48xPZ7lilH05cM4cZfmcMk= Original-Xref: shelby.stanford.edu gnu.emacs.help:130796 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26451 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26451 Thien-Thi Nguyen writes: > i just looked at image.c:1661 (lookup_image), which sez: > > /* If not found, create a new image and cache it. */ > if (img == NULL) > > probably immediately prior to this block is the best place to add > a file timestamp check. that's not as pretty a solution as fully > generalizing the check to some kind of `:volatile VOLATILE-SPEC': > > :volatile VOLATILE-SPEC > > If VOLATILE-SPEC is t, take extra steps to check for "image > change" so that image-cache lookup can DTRT [obviously this > documentation can be improved ;-]. If :file is specified, > use the timestamp of the file. Otherwise, compute a hash of > the data and use that to detect change. > > VOLATILE-SPEC may also be a function that takes one argument, > either the file timestamp or the data (as a string), and returns > non-nil to indicate that the image has changed. > > i was all fired up and ready to do some quick munging and post > code (thereby procrastinating on other emacs munging for vms :-), > but then i saw how image.c leaves file loading to each image type > (not enough abstraction for my tastes) so all the gumption seeped > away... > > perhaps post-release i (or someone else) will do the requisite > refactoring so that :volatile or like can be added more easily. Sounds like a good idea. I can wait, my hack is working quite nicely for now. /Mathias