mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:36:26 +00:00
ob-R.el: org-babel-R-evaluate-session finds prompts more reliably
* lisp/ob-R.el (org-babel-R-evaluate-session) should find prompts more reliably. First, the regular expression used requires spacing between and after instances of `[>+.]'. Also, the search terminates at the first `\n', so complicated results with prompt like strings in them are not deleted. Prompt finding is necessarily heuristic. It may be necessary to render the regular expression with a defcustom as is done in ess-mode.
This commit is contained in:
parent
635aae3917
commit
27aa7b3f1e
|
@ -444,7 +444,8 @@ last statement in BODY, as elisp."
|
|||
(mapcar
|
||||
(lambda (line) ;; cleanup extra prompts left in output
|
||||
(if (string-match
|
||||
"^\\([ ]*[>+\\.][ ]?\\)+\\([[0-9]+\\|[ ]\\)" line)
|
||||
"^\\([>+.]\\([ ][>.+]\\)*[ ]\\)"
|
||||
(car (split-string line "\n")))
|
||||
(substring line (match-end 1))
|
||||
line))
|
||||
(org-babel-comint-with-output (session org-babel-R-eoe-output)
|
||||
|
|
Loading…
Reference in a new issue