From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Piet van Oostrum Newsgroups: gmane.emacs.help Subject: Re: dired copy marked files in xterm Date: Wed, 27 Feb 2008 11:49:36 +0100 Organization: Dept of Computer Science, Utrecht University, The Netherlands Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204112508 7149 80.91.229.12 (27 Feb 2008 11:41:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Feb 2008 11:41:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 27 12:42:05 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JUKfa-000435-CU for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Feb 2008 12:41:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUKf4-0001mI-6O for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Feb 2008 06:41:22 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news.f.de.plusline.net!news.mb-net.net!open-news-network.org!news.stack.nl!cs.uu.nl!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-NNTP-Posting-Host: adonis.cs.uu.nl Original-X-Trace: prometheus.cs.uu.nl 1204109400 3164 131.211.80.24 (27 Feb 2008 10:50:00 GMT) Original-X-Complaints-To: news@cs.uu.nl Original-NNTP-Posting-Date: Wed, 27 Feb 2008 10:50:00 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.90 (darwin) Cancel-Lock: sha1:tuxFwMleXQrRtBsXKm6GN6eUr48= Original-Xref: shelby.stanford.edu gnu.emacs.help:156539 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51910 Archived-At: >>>>> Fabian Braennstroem (FB) wrote: >FB> Thanks for your help! This works good with a small adjustment. >FB> A different problem is to use 'scp' or in my case something similar, in my case 'hput'. It copies the file to the cluster with a syntax like: >FB> hput -R cluster_directory files_to_copy >FB> Using: 'hput -R /some_remote_directory *' as a shell-command works, but a small adjustment of your line: >FB> (defun hputbackground() >FB> "Put" >FB> (interactive) >FB> (message (dired-dwim-target-directory)) >FB> (message (replace-regexp-in-string "/rsh:ppb37@10.134.130.2:" "" (dired-dwim-target-directory))) >FB> (call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'hput -R " (replace-regexp-in-string "/rsh:ppb37@10.134.130.2:" "" (dired-dwim-target-directory)) nil) " " (dired-get-marked-files) " '&")) >FB> ;(call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'cp -R " (dired-get-marked-files) nil) " " (dired-dwim-target-directory) " '&")) >FB> ) >FB> gives me this error: >FB> /rsh:ppb37@10.134.130.2:/home/ppb37/ >FB> /home/ppb37/ >FB> shell-quote-argument: Wrong type argument: stringp, 47 >FB> Do you have an idea!? Yes, (dired-get-marked-files) should be used as the second argument of dired-shell-stuff-it. So I guess you should use something like: (concat (dired-shell-stuff-it (concat "xterm -e 'hput -R " (replace-regexp-in-string "/rsh:ppb37@10.134.130.2:" "" (dired-dwim-target-directory))) (dired-get-marked-files) nil) " '&") (defun dired-shell-stuff-it (command file-list on-each &optional raw-arg) ;; "Make up a shell command line from COMMAND and FILE-LIST. ;; If ON-EACH is t, COMMAND should be applied to each file, else ;; simply concat all files and apply COMMAND to this. ;; FILE-LIST's elements will be quoted for the shell." (raw-arg isn't used) -- Piet van Oostrum URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: piet@vanoostrum.org