org-babel-eval: Return command output even upon failure

* lisp/ob-eval.el (org-babel-eval): Return the available command
output even when the command fails.

This is useful for bash scripts that can produce useful output even
upon failing.  The error window is still displayed to inform users.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2czakgpk8.fsf@me.com
This commit is contained in:
Ihor Radchenko 2022-10-23 12:22:25 +08:00
parent ab7eff9d9c
commit f8a9cd2308
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -71,7 +71,8 @@ its results, otherwise display STDERR with
(compilation-mode))
;; Compilation-mode enforces read-only, but Babel expects the buffer modifiable.
(setq buffer-read-only nil))))
nil)
;; Return output, if any.
(buffer-string))
(buffer-string)))))
(defun org-babel-eval-read-file (file)