emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas Alexander Gerds <tag@biostat.ku.dk>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Bastien <bzg@gnu.org>, emacs-orgmode@gnu.org
Subject: Re: minor bug in babel with silent output and remote R session
Date: Mon, 15 Apr 2013 14:56:39 +0200	[thread overview]
Message-ID: <grb61561zoeyuw.fsf@linuxifsv005.sund.root.ku.dk> (raw)
In-Reply-To: <871uadf39l.fsf@gmail.com> (Eric Schulte's message of "Sun, 14 Apr 2013 09:23:07 -0600")


hmm. I agree that this should be handled by ESS and I have not given up yet.

as indicated in my previous mail, I dont know how to test if an
R-session is remote because the command ess-remote deletes all local
variables. a hack would be to let the R-process evaluate

file.exists((file-name-directory org-babel-temp-file))

thanks

Eric Schulte <schulte.eric@gmail.com> writes:

> It is a shame that this can't be handled gracefully either through ESS
> or R code.
>
> I agree it would be nice to raise a warning rather than hang waiting
> for a file which won't ever exist.  So, how can we tell from the Babel
> source if the R session is remote?
>
> Thanks,
>
> Thomas Alexander Gerds <tag@biostat.ku.dk> writes:
>
>> 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.file))}
>>    
>> 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
>>
>>
>>  
>> Eric Schulte <schulte.eric@gmail.com> writes:
>>
>>> Bastien <bzg@gnu.org> writes:
>>>
>>>> Hi Thomas, thanks for the follow-up.  Thomas Alexander Gerds
>>>> <tag@biostat.ku.dk> 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, Øster Farimagsgade 5, 1014 Copenhagen,
>> Denmark Office: CSS-15.2.07 (Gamle Kommunehospital) tel: 35327914
>> (sec: 35327901)
--
Thomas A. Gerds -- Assoc. Prof. Department of Biostatistics
University of Copenhagen, Øster Farimagsgade 5, 1014 Copenhagen, Denmark
Office: CSS-15.2.07 (Gamle Kommunehospital)
tel: 35327914 (sec: 35327901) 

  reply	other threads:[~2013-04-15 12:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13  7:49 minor bug in babel with silent output and remote R session Thomas Alexander Gerds
2013-03-13 15:11 ` Eric Schulte
2013-03-13 16:29   ` Thomas Alexander Gerds
2013-04-07  7:45 ` Bastien
2013-04-07  8:42   ` Achim Gratz
2013-04-09  8:13   ` Thomas Alexander Gerds
2013-04-10 12:44     ` Bastien
2013-04-12 21:57       ` Eric Schulte
2013-04-14  9:50         ` Thomas Alexander Gerds
2013-04-14 15:23           ` Eric Schulte
2013-04-15 12:56             ` Thomas Alexander Gerds [this message]
2013-04-15 12:34     ` Andreas Leha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=grb61561zoeyuw.fsf@linuxifsv005.sund.root.ku.dk \
    --to=tag@biostat.ku.dk \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).