From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Image cache Date: Tue, 07 Feb 2006 12:52:45 +0200 Organization: JURTA Message-ID: <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 1139325948 391 80.91.229.2 (7 Feb 2006 15:25:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2006 15:25:48 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 07 16:25:47 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 1F6UiV-0007SZ-H7 for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2006 16:25:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6UeI-0005WR-C1 for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2006 10:20:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6SFZ-0006ma-00 for emacs-devel@gnu.org; Tue, 07 Feb 2006 07:47:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6SFV-0006k7-PY for emacs-devel@gnu.org; Tue, 07 Feb 2006 07:47:15 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6SE8-0006H4-6b for emacs-devel@gnu.org; Tue, 07 Feb 2006 07:45:48 -0500 Original-Received: from [194.126.101.98] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6SDq-0003P6-IP for emacs-devel@gnu.org; Tue, 07 Feb 2006 07:45:30 -0500 Original-Received: from mail.neti.ee (80-235-37-58-dsl.mus.estpak.ee [80.235.37.58]) by Relayhost2.neti.ee (Postfix) with ESMTP id 186B73D1E for ; Tue, 7 Feb 2006 14:42:17 +0200 (EET) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee 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:50152 Archived-At: After generating different images in the same file and visiting them after every change in Emacs, I noticed that the displayed image doesn't get updated. Later I found the variable image-cache-eviction-delay and changed its value to a small delay (1 sec), but it didn't have any effect contrary to its documentation: the changed image was not updated in the cache. It seems this behavior is caused by the constant value #define CLEAR_IMAGE_CACHE_COUNT 101 that checks the value of image-cache-eviction-delay only on 101-st redisplay. Surely, I can use (add-hook 'post-command-hook 'clear-image-cache), but this is not a general solution. 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. -- Juri Linkov http://www.jurta.org/emacs/