diff options
Diffstat (limited to 'lisp/ob-R.el')
-rw-r--r-- | lisp/ob-R.el | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/lisp/ob-R.el b/lisp/ob-R.el index 3dedb39..67d3c37 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -1,6 +1,6 @@ ;;; ob-R.el --- org-babel functions for R code evaluation -;; Copyright (C) 2009-2012 Free Software Foundation, Inc. +;; Copyright (C) 2009-2013 Free Software Foundation, Inc. ;; Author: Eric Schulte ;; Dan Davison @@ -28,9 +28,6 @@ ;;; Code: (require 'ob) -(require 'ob-ref) -(require 'ob-comint) -(require 'ob-eval) (eval-when-compile (require 'cl)) (declare-function orgtbl-to-tsv "org-table" (table params)) @@ -212,6 +209,9 @@ This function is called by `org-babel-execute-src-block'." (if (org-babel-comint-buffer-livep session) session (save-window-excursion + (when (get-buffer session) + ;; Session buffer exists, but with dead process + (set-buffer session)) (require 'ess) (R) (rename-buffer (if (bufferp session) @@ -240,7 +240,7 @@ current code buffer." '((:bmp . "bmp") (:jpg . "jpeg") (:jpeg . "jpeg") - (:tex . "tikz") + (:tikz . "tikz") (:tiff . "tiff") (:png . "png") (:svg . "svg") @@ -302,11 +302,10 @@ last statement in BODY, as elisp." (format "{function ()\n{\n%s\n}}()" body) (org-babel-process-file-name tmp-file 'noquote))) (org-babel-R-process-value-result - (if (or (member "scalar" result-params) - (member "verbatim" result-params)) - (with-temp-buffer - (insert-file-contents tmp-file) - (buffer-string)) + (org-babel-result-cond result-params + (with-temp-buffer + (insert-file-contents tmp-file) + (buffer-string)) (org-babel-import-elisp-from-file tmp-file '(16))) column-names-p))) (output (org-babel-eval org-babel-R-command body)))) @@ -335,11 +334,10 @@ last statement in BODY, as elisp." "FALSE") ".Last.value" (org-babel-process-file-name tmp-file 'noquote))) (org-babel-R-process-value-result - (if (or (member "scalar" result-params) - (member "verbatim" result-params)) - (with-temp-buffer - (insert-file-contents tmp-file) - (buffer-string)) + (org-babel-result-cond result-params + (with-temp-buffer + (insert-file-contents tmp-file) + (buffer-string)) (org-babel-import-elisp-from-file tmp-file '(16))) column-names-p))) (output |