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.
This commit is contained in:
Aaron Ecay 2014-10-10 00:35:41 -04:00
parent fac4677e51
commit fcce67cdeb
1 changed files with 4 additions and 3 deletions

View File

@ -270,9 +270,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)