소스 검색

org-babel: remove prompt characters from R output

When evaluating R code in a persistent session, lines of output
typically start with a single prompt character. However, under certain
circumstances, lines start with a concatenation of (primary and
secondary) prompt characters separated by spaces. This seems to be
related to having blank lines in the input. This fix ensures that all
such prompt characters are removed from the output.
Dan Davison 16 년 전
부모
커밋
64c26c6561
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      contrib/babel/lisp/langs/org-babel-R.el

+ 6 - 0
contrib/babel/lisp/langs/org-babel-R.el

@@ -155,6 +155,12 @@ last statement in BODY, as elisp."
 		 (mapconcat #'org-babel-chomp (list body org-babel-R-eoe-indicator) "\n"))))
 	     (raw (org-babel-comint-with-output buffer org-babel-R-eoe-output nil
                     (insert full-body) (inferior-ess-send-input)))
+	     (comint-prompt-regexp
+	      (concat "^\\("
+		      inferior-ess-primary-prompt
+		      "\\|"
+		      inferior-ess-secondary-prompt
+		      "\\)*"))
 	     broke results)
         (case result-type
           (value (org-babel-R-process-value-result