summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Davison <davison@stats.ox.ac.uk>2010-08-17 16:44:28 -0400
committerDan Davison <davison@stats.ox.ac.uk>2010-08-17 17:32:23 -0400
commita4c8bcd31b7dfae9e9922671ccee0ba7ddffd288 (patch)
treeadbcc313e1a25179af1ee69d0bcf64df8bb5e473
parentb61e0c4dfc1176d2745368e728f1cbf3e5cfede3 (diff)
downloadorg-mode-a4c8bcd31b7dfae9e9922671ccee0ba7ddffd288.tar.gz
babel: implement association of R code buffers with R session
* ob-R.el (org-babel-R-associate-session): New function to associate R code edit buffers with ESS comint session.
-rw-r--r--lisp/ob-R.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index e9633ae2..7d46437 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -168,6 +168,14 @@ This function is called by `org-babel-execute-src-block'."
(buffer-name))))
(current-buffer))))))
+(defun org-babel-R-associate-session (session)
+ "Associate R code buffer with an R session.
+Make SESSION be the inferior ESS process associated with the
+current code buffer."
+ (setq ess-local-process-name
+ (process-name (get-buffer-process session)))
+ (ess-make-buffer-current))
+
(defun org-babel-R-construct-graphics-device-call (out-file params)
"Construct the call to the graphics device."
(let ((devices