[EMAIL PROTECTED] wrote:
> I just found that I added a minor improvement in the meantime. Using
> 'shell-quote-argument' file names with spaces and such are working.
>
> Here is the new version:
>
> ;-----------------------------------------------------------------
> (defun dired-do-shell-command-in-background (command)
> "In dired, do shell command in background on the file or directory named on this line."
>   (interactive
> (list (dired-read-shell-command (concat "& on " "%s: ") nil (list (dired-get-filename))))) > (call-process command nil 0 nil (shell-quote-argument (dired-get-filename))))

That doesn't make sense to me.  call-process passes its &rest ARGS
directly to PROGRAM, without any word-splitting etc. by the shell.  So
shell-quote-argument is unecessary, and in fact could introduce quoting
characters that would be interpreted as part of the file name.

If COMMAND is actually a shell command (i.e. with redirection operators
etc.) then you must use shell-command instead of call-process.  If it is
just a program, then using call-process is fine -- but again, using
shell-quote-argument with it is not.

--
Kevin Rodgers



_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to