babel: org-babel-R is better about trimming preceding and trailing newlines
* contrib/babel/lisp/langs/org-babel-R.el (org-babel-R-evaluate): trimming preceding and trailing newlines of output results
This commit is contained in:
parent
f6e4790099
commit
512ad1e30d
|
@ -186,7 +186,7 @@ last statement in BODY, as elisp."
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert body)
|
(insert body)
|
||||||
(org-babel-shell-command-on-region (point-min) (point-max) "R --slave --no-save" 'current-buffer 'replace)
|
(org-babel-shell-command-on-region (point-min) (point-max) "R --slave --no-save" 'current-buffer 'replace)
|
||||||
(buffer-string)))
|
(org-babel-trim (buffer-string))))
|
||||||
(value
|
(value
|
||||||
(let* ((tmp-file (make-temp-file "R-out-functional-results")) exit-code
|
(let* ((tmp-file (make-temp-file "R-out-functional-results")) exit-code
|
||||||
(stderr
|
(stderr
|
||||||
|
@ -235,7 +235,7 @@ last statement in BODY, as elisp."
|
||||||
(if (= (length el) 0)
|
(if (= (length el) 0)
|
||||||
nil
|
nil
|
||||||
(if (string-match comint-prompt-regexp el)
|
(if (string-match comint-prompt-regexp el)
|
||||||
(substring el (match-end 0))
|
(org-babel-trim (substring el (match-end 0)))
|
||||||
el)))))
|
el)))))
|
||||||
(mapconcat
|
(mapconcat
|
||||||
#'identity
|
#'identity
|
||||||
|
|
Loading…
Reference in New Issue