From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: safe-magic for image-file-handler Date: Wed, 02 Mar 2005 23:59:05 +0200 Organization: JURTA Message-ID: <87zmxlg15i.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 1109814393 28505 80.91.229.2 (3 Mar 2005 01:46:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2005 01:46:33 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 03 02:46:33 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D6fPt-00021T-Eg for ged-emacs-devel@m.gmane.org; Thu, 03 Mar 2005 02:46:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6fil-00076Q-DB for ged-emacs-devel@m.gmane.org; Wed, 02 Mar 2005 21:05:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D6fi6-0006mN-CT for emacs-devel@gnu.org; Wed, 02 Mar 2005 21:05:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D6fi0-0006kE-Rf for emacs-devel@gnu.org; Wed, 02 Mar 2005 21:05:02 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6fi0-0006iz-DY for emacs-devel@gnu.org; Wed, 02 Mar 2005 21:05:00 -0500 Original-Received: from [194.126.101.114] (helo=HOT-Bounce1.hot.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D6fPn-00028u-6n for emacs-devel@gnu.org; Wed, 02 Mar 2005 20:46:11 -0500 Original-Received: from MXR-1.estpak.ee (unknown [192.168.1.20]) by HOT-Bounce1.hot.ee (Postfix) with ESMTP id 0FE7E93476 for ; Thu, 3 Mar 2005 03:39:58 +0200 (EET) Original-Received: from mail.neti.ee (80-235-39-115-dsl.mus.estpak.ee [80.235.39.115]) by MXR-1.estpak.ee (Postfix) with ESMTP id 584BD1717EE for ; Thu, 3 Mar 2005 03:45:39 +0200 (EET) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110002 (No Gnus v0.2) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:34111 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34111 With auto-image-file-mode turned on, `!' (`dired-do-shell-command') called on a image file in the *Locate* buffer (created by the `M-x locate' command) doesn't work, because `dired-get-filename' puts "/:" at the beginning of the file name, and then the file name with the leading "/:" is given as an argument to the shell command. It seems the correct fix is to put safe-magic property: (put 'image-file-handler 'safe-magic t) in image-file.el. But generally, the solution of using safe-magic doesn't seem right to me. Maybe a better solution would be to eliminate safe-magic property entirely, and to let `dired-get-filename' to always add "/:", but to remove it somewhere in low-level functions (e.g. in `call-process' or `file-name-non-special') just before giving a file name to the external command. This will also allow the correct processing of commands where users put "/:" explicitly, for example: C-x C-f /:/some/dir/file.gz RET which currently doesn't work. BTW, auto-image-file-mode doesn't handle image files visited inside compressed files visited with auto-compression-mode. Are there plans to improve auto-image-file-mode to handle such situations? This is a necessary feature. -- Juri Linkov http://www.jurta.org/emacs/