From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Alexander Gerds Subject: Re: minor bug in babel with silent output and remote R session Date: Sun, 14 Apr 2013 11:50:23 +0200 Message-ID: <86txn95tls.fsf@biostat.ku.dk> References: <87ppy6sq69.fsf@bzg.ath.cx> <87zjx6ed7d.fsf@bzg.ath.cx> <87vc7re5kw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URJZv-0002Zf-Ok for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 05:50:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URJZr-0004Mo-T8 for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 05:50:31 -0400 In-Reply-To: <87vc7re5kw.fsf@gmail.com> (Eric Schulte's message of "Fri, 12 Apr 2013 15:57:11 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Bastien , emacs-orgmode@gnu.org yes, I am using ESS. ess-remote allows me to evaluate R-code from the local emacs-session on a remote machine connected to via ssh. there are two problems: 1) the remote machine cannot write to org-babel-temp-file because the tmp-directory exists on the local machine. here we could add if(!file.exists(dirname(transfer.file))){dir.create(dirname(transfer.fil= e))} =20=20=20 in the middle of the variable org-babel-R-write-object-command this would achieve that the file is at least generated on the remote host. 2) however, still the transfer file does not exist on the local machine. there are several possiblities: a) tell org-babel-comint-eval-invisibly-and-wait-for-file that the file is remote and then test if (concat "/" username "@" host ":" file) exists instead of file. b) use tramp to transfer the file from the remote to the local machine. the function ssh does define ssh-host and ssh-username, however, calling ess-remote removes these variables again. c) tell org-babel-comint-eval-invisibly-and-wait-for-file not to wait for file if it is remote my conclusion: it would be nice to have this functionality, but perhaps it is not worth the efforts and it would be sufficient to avoid the endless loop when waiting for a file which never will generated. cheers thomas =20 Eric Schulte writes: > Bastien writes: > >> Hi Thomas, >> thanks for the follow-up. >> Thomas Alexander Gerds writes: >> >>> I think that I can describe the problem a bit better now. It is not >>> related to the silent option but occurs whenever ":results value". >>> Emacs freezes due to the following line in >>> org-babel-comint-eval-invisibly-and-wait-for-file >>> (while (not (file-exists-p file)) (sit-for (or period 0.25))) >>> it seems that R cannot transfer the file and hence this is an >>> endless loop. >> I'm not knowledgeable enough in this area to provide a fix, maybe >> someone else will. >> > > Could this be a problem with whatever tool (I'm assuming ESS) you are > using to maintain the R session and generate the R file? > > Perhaps babel needs to modify the R code used to create the file (held > in the `org-babel-R-write-object-command' variable). Could you take a > shot at providing another version of this variable? I don't really > use R myself. > > Thanks, -- Thomas A. Gerds -- Assoc. Prof. Department of Biostatistics University of Copenhagen, =D8ster Farimagsgade 5, 1014 Copenhagen, Denmark Office: CSS-15.2.07 (Gamle Kommunehospital) tel: 35327914 (sec: 35327901)=20