Hi Henrik,

2014ko urriak 8an, Henrik Singmann-ek idatzi zuen:
> 
> I unfortunately can confirm that org-babel-R-initiate-session contains
> the lines you mentioned at exactly 15 lines down. Deleting ob-R.elc
> (which was of the same date as ob-R.el) didn't affect anything as did
> reloading org uncompiled (C-u C-c C-x !).

I could reproduce this, also with recent git org and ESS.  It looks like
ESS is doing more complicated things, necessitating a more thorough
check that the session is in fact ready.

Can you test the attached patch?  It fixed the problem for me.
>From b91526d932728749609b27809eecb588c04e1a1e Mon Sep 17 00:00:00 2001
From: Aaron Ecay <aarone...@gmail.com>
Date: Fri, 10 Oct 2014 00:35:41 -0400
Subject: [PATCH] ob-R: fix interaction with ESS for new sessions

* lisp/ob-R.el (org-babel-R-initiate-session): Properly wait on a new
ESS process.
---
 lisp/ob-R.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index ea33031..5d5006f 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -265,9 +265,10 @@ This function is called by `org-babel-execute-src-block'."
 	    ;; Session buffer exists, but with dead process
 	    (set-buffer session))
 	  (require 'ess) (R)
-	  (ess-wait-for-process
-	   (get-process (or ess-local-process-name
-			    ess-current-process-name)))
+	  (let ((R-proc (get-process (or ess-local-process-name
+					 ess-current-process-name))))
+	    (while (process-get R-proc 'callbacks)
+	      (ess-wait-for-process R-proc)))
 	  (rename-buffer
 	   (if (bufferp session)
 	       (buffer-name session)
-- 
2.1.2

Thanks,

-- 
Aaron Ecay

Reply via email to