lisp/ob-comint.el: Create comint echo filter
* lisp/ob-comint.el (org-babel-comint--echo-filter): Extract echo filtering logic from `org-babel-comint-with-output' into a new function.
This commit is contained in:
parent
c2b763dd14
commit
3776eba2f7
|
@ -87,6 +87,15 @@ PROMPT-REGEXP defaults to `comint-prompt-regexp'."
|
||||||
separator string)))
|
separator string)))
|
||||||
(delete "" (split-string string separator))))
|
(delete "" (split-string string separator))))
|
||||||
|
|
||||||
|
(defun org-babel-comint--echo-filter (string &optional echo)
|
||||||
|
"Remove ECHO from STRING."
|
||||||
|
(and echo string
|
||||||
|
(string-match
|
||||||
|
(replace-regexp-in-string "\n" "[\r\n]+" (regexp-quote echo))
|
||||||
|
string)
|
||||||
|
(setq string (substring string (match-end 0))))
|
||||||
|
string)
|
||||||
|
|
||||||
(defmacro org-babel-comint-with-output (meta &rest body)
|
(defmacro org-babel-comint-with-output (meta &rest body)
|
||||||
"Evaluate BODY in BUFFER and return process output.
|
"Evaluate BODY in BUFFER and return process output.
|
||||||
Will wait until EOE-INDICATOR appears in the output, then return
|
Will wait until EOE-INDICATOR appears in the output, then return
|
||||||
|
|
Loading…
Reference in New Issue