Function: org-babel-comint-wait-for-output
org-babel-comint-wait-for-output is a byte-compiled function defined
in ob-comint.el.gz.
Signature
(org-babel-comint-wait-for-output BUFFER)
Documentation
Wait until output arrives from BUFFER.
Note: this is only safe when waiting for the result of a single statement (not large blocks of code).
Source Code
;; Defined in /usr/src/emacs/lisp/org/ob-comint.el.gz
(defun org-babel-comint-wait-for-output (buffer)
"Wait until output arrives from BUFFER.
Note: this is only safe when waiting for the result of a single
statement (not large blocks of code)."
(org-babel-comint-in-buffer buffer
(let ((start-time (current-time)))
(while (progn
(goto-char comint-last-input-end)
(not (and (re-search-forward comint-prompt-regexp nil t)
(goto-char (match-beginning 0)))))
(accept-process-output
(get-buffer-process buffer)
org-babel-comint-fallback-regexp-threshold)
(when (and org-babel-comint-prompt-regexp-old
(> (float-time (time-since start-time))
org-babel-comint-fallback-regexp-threshold)
(progn
(goto-char comint-last-input-end)
(save-excursion
(re-search-forward
org-babel-comint-prompt-regexp-old nil t))))
(org-babel-comint--set-fallback-prompt))))))