1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-26 07:33:39 +00:00

org-babel-comit-with-output: Fix when prompt is emitted partially

* lisp/ob-comint.el (org-babel-comint-with-output): Do not rely on
output filter when detecting prompt lines.  Search for
`comint-prompt-regexp' in the full output after applying the filter.
This is needed when the filter is supplied with partial prompts.

Reported-by: Frédéric Santos <frederic.santos@u-bordeaux.fr>
Link: https://orgmode.org/list/877czca7oj.fsf@u-bordeaux.fr
This commit is contained in:
Ihor Radchenko 2022-12-02 13:57:14 +08:00
parent d122c2b5b4
commit 4564627415
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -117,6 +117,14 @@ or user `keyboard-quit' during execution of body."
(goto-char (process-mark (get-buffer-process (current-buffer))))
(insert dangling-text)
;; Replace partially supplied input lines.
;; This is needed when output filter spits partial lines that
;; do not include a full prompt at a time.
(setq string-buffer
(replace-regexp-in-string
comint-prompt-regexp
,org-babel-comint-prompt-separator
string-buffer))
;; remove echo'd FULL-BODY from input
(when (and ,remove-echo ,full-body
(string-match