help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: dired copy marked files in xterm


From: Piet van Oostrum
Subject: Re: dired copy marked files in xterm
Date: Tue, 26 Feb 2008 11:22:25 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.90 (darwin)

>>>>> Fabian Braennstroem <f.braennstroem@gmx.de> (FB) wrote:

>FB> Hi,

>FB>     I would like to use the system 'cp' function in an xterm
>FB>     to copy marked files in dired.
>FB>     Right now, this small function works with the current
>FB>     file:

>FB> (defun tacopybackground(var1)
>FB>     "Copy"
>FB>   (interactive)
>FB>        (call-process-shell-command (concat "xterm -e 'cp -R 
>"(dired-get-filename)" " (dired-dwim-target-directory) " &'"))
>FB>        )

>FB>     but obviously it needs some kind of loop or different
>FB>     approach for marked files!?:

>FB>        (call-process-shell-command (concat "xterm -e 'cp -R 
>"(dired-get-marked-files)" " (dired-dwim-target-directory) " &'"))

Does this what you want?

       (call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'cp 
-R " (dired-get-marked-files) nil) " " (dired-dwim-target-directory) " &'"))

By the way, you may have to do some additional shell-quoting on the target
directory. dired-shell-stuff-t does it on the file list. 
-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet@vanoostrum.org


reply via email to

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