emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

safe-magic for image-file-handler


From: Juri Linkov
Subject: safe-magic for image-file-handler
Date: Wed, 02 Mar 2005 23:59:05 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux)

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]