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: Image cache Date: Tue, 07 Feb 2006 15:59:29 -0500 Message-ID: <878xsmewfo.fsf-monnier+emacs@gnu.org> References: <87bqxjjwii.fsf_-_@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1139346147 21655 80.91.229.2 (7 Feb 2006 21:02:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2006 21:02:27 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 07 22:02:15 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F6Zxn-0006G4-UR for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2006 22:01:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6Zxl-0006O4-UY for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2006 16:01:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6Zvz-00063n-To for emacs-devel@gnu.org; Tue, 07 Feb 2006 15:59:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6Zvx-00062J-5U for emacs-devel@gnu.org; Tue, 07 Feb 2006 15:59:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6Zvw-000621-Cj for emacs-devel@gnu.org; Tue, 07 Feb 2006 15:59:32 -0500 Original-Received: from [209.226.175.184] (helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6Zz6-0001wZ-Fe for emacs-devel@gnu.org; Tue, 07 Feb 2006 16:02:48 -0500 Original-Received: from alfajor ([67.71.117.239]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060207205931.XSAE16473.tomts22-srv.bellnexxia.net@alfajor>; Tue, 7 Feb 2006 15:59:31 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 5C192D73CA; Tue, 7 Feb 2006 15:59:29 -0500 (EST) Original-To: Juri Linkov In-Reply-To: <87bqxjjwii.fsf_-_@jurta.org> (Juri Linkov's message of "Tue, 07 Feb 2006 12:52:45 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:50169 Archived-At: > OTOH, I don't see why I should change the value of image-cache-eviction-delay, > if it is Emacs' job to update the cache when the image data changes. > So I found that updating the image cache after visiting an new image > was correct before the 2006-01-30 change in image-mode.el: > * image-mode.el (image-toggle-display): Use file name if possible, > instead of unnecessarily allocating a (possibly huge) lisp string. > But I don't blame this change. It is a good optimization, but it > revealed a problem in cache processing code. This code doesn't update > the cache for the file name when the file contents changes. If someone has the time, it seems it migt be worth it to do something along the following lines: - add `loadtime' timestamp to the image data-structure so that staleness can be detected and a `refresh' function in the image_type data structure which, given the `loadtime' image `spec' says whether to reload or not. - provide a new function (image-refresh IMAGE-SPEC). - make create-image (used by image-toggle-display and others) use that new function. Stefan