unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* safe-magic for image-file-handler
@ 2005-03-02 21:59 Juri Linkov
  0 siblings, 0 replies; only message in thread
From: Juri Linkov @ 2005-03-02 21:59 UTC (permalink / raw)


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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-02 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-02 21:59 safe-magic for image-file-handler Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).