|
@@ -76,7 +76,7 @@
|
|
|
:version "24.1"
|
|
|
:type 'string)
|
|
|
|
|
|
-(defvar ess-local-process-name)
|
|
|
+(defvar ess-local-process-name) ; dynamically scoped
|
|
|
(defun org-babel-edit-prep:R (info)
|
|
|
(let ((session (cdr (assoc :session (nth 2 info)))))
|
|
|
(when (and session (string-match "^\\*\\(.+?\\)\\*$" session))
|
|
@@ -201,13 +201,14 @@ This function is called by `org-babel-execute-src-block'."
|
|
|
name file header row-names max))))
|
|
|
(format "%s <- %s" name (org-babel-R-quote-tsv-field value))))
|
|
|
|
|
|
-(defvar ess-ask-for-ess-directory nil)
|
|
|
+(defvar ess-ask-for-ess-directory) ; dynamically scoped
|
|
|
(defun org-babel-R-initiate-session (session params)
|
|
|
"If there is not a current R process then create one."
|
|
|
(unless (string= session "none")
|
|
|
(let ((session (or session "*R*"))
|
|
|
(ess-ask-for-ess-directory
|
|
|
- (and ess-ask-for-ess-directory (not (cdr (assoc :dir params))))))
|
|
|
+ (and (and (boundp 'ess-ask-for-ess-directory) ess-ask-for-ess-directory)
|
|
|
+ (not (cdr (assoc :dir params))))))
|
|
|
(if (org-babel-comint-buffer-livep session)
|
|
|
session
|
|
|
(save-window-excursion
|
|
@@ -220,7 +221,6 @@ This function is called by `org-babel-execute-src-block'."
|
|
|
(buffer-name))))
|
|
|
(current-buffer))))))
|
|
|
|
|
|
-(defvar ess-local-process-name nil)
|
|
|
(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
|