diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:27 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:27 +0200 |
commit | e32a45ed36d6000db4b39171149072d11b77af72 (patch) | |
tree | b5f4a7d43022c08c3298e82b3e9fc50f68be660f /lisp/ob-R.el | |
parent | 7697fa4daf3ec84f85711a84035d8f0224afd4e3 (diff) |
Imported Upstream version 8.0.7
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 |