From 24bb01afc81d441e910fa1db39d3b5a2397d6589 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Tue, 27 Jul 2010 12:16:32 -0600 Subject: [PATCH] ob-R: clean up extra prompts in session output Thanks to Charles C. Berry for pointing this issue out * lisp/ob-R.el (org-babel-R-evaluate): clean up extra prompts in session output --- lisp/ob-R.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index 2c3ee50e9..603c1c356 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -258,7 +258,10 @@ return the value of the last statement in BODY, as elisp." (butlast (delq nil (mapcar - #'identity + (lambda (line) ;; cleanup extra prompts left in output + (if (string-match "^\\([ >]+\\)\\[[0-9]+\\]" line) + (substring line (match-end 1)) + line)) (org-babel-comint-with-output (session org-babel-R-eoe-output) (insert (mapconcat #'org-babel-chomp (list body org-babel-R-eoe-indicator)