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: Re: Image cache Date: Wed, 08 Feb 2006 11:23:29 +0200 Organization: JURTA Message-ID: <87bqxiuno6.fsf@jurta.org> References: <87bqxjjwii.fsf_-_@jurta.org> <87mzh3krtx.fsf@stupidchicken.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1139422052 20022 80.91.229.2 (8 Feb 2006 18:07:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Feb 2006 18:07:32 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 08 19:07:24 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 1F6tho-0002ez-CA for ged-emacs-devel@m.gmane.org; Wed, 08 Feb 2006 19:06:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6qiz-0000Lu-4w for ged-emacs-devel@m.gmane.org; Wed, 08 Feb 2006 09:55:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6nBG-0003x6-Qb for emacs-devel@gnu.org; Wed, 08 Feb 2006 06:08:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6n5X-0002m2-0d for emacs-devel@gnu.org; Wed, 08 Feb 2006 06:03:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6mzh-0001Tb-HD for emacs-devel@gnu.org; Wed, 08 Feb 2006 05:56:19 -0500 Original-Received: from [194.126.101.98] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6n2z-0007un-NE for emacs-devel@gnu.org; Wed, 08 Feb 2006 05:59:41 -0500 Original-Received: from mail.neti.ee (80-235-40-102-dsl.mus.estpak.ee [80.235.40.102]) by Relayhost1.neti.ee (Postfix) with ESMTP id 1333F21DB; Wed, 8 Feb 2006 12:56:14 +0200 (EET) Original-To: Chong Yidong In-Reply-To: <87mzh3krtx.fsf@stupidchicken.com> (Chong Yidong's message of "Tue, 07 Feb 2006 12:21:30 -0500") 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:50208 Archived-At: >> * image-mode.el (image-toggle-display): Use file name if possible, >> instead of unnecessarily allocating a (possibly huge) lisp string. > > Ugh. Two simple solutions come to mind: (i) revert my change, or (ii) > clear the image cache on each call to image-toggle-display. I don't > know which is worse, performance-wise -- any suggestions? Your change also has another undesirable effect: if doesn't handle the situation when Emacs can't read the image. It visits the image file in text mode but thinks that it is in image mode (i.e. hides the cursor and prints a wrong message in the echo area). Before your change handling this situation in image-mode.el was not nice either: with debug-on-error=t it signalled an error "Cannot determine image type", and with debug-on-error=nil this error was not reported at all. -- Juri Linkov http://www.jurta.org/emacs/