org-babel-eval-error-notify: Avoid uninformative empty error buffer

* lisp/ob-eval.el (org-babel-eval-error-notify): When STDERR is empty,
display the exit code in the error buffer rather than empty buffer.

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:21:15 +08:00
parent 1ef420b19d
commit ab7eff9d9c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 1 deletions

View File

@ -39,7 +39,11 @@
(let ((buf (get-buffer-create org-babel-error-buffer-name)))
(with-current-buffer buf
(goto-char (point-max))
(save-excursion (insert stderr)))
(save-excursion
(insert
(if (string-empty-p stderr)
(format "[ Babel evaluation exited with code %S ]" exit-code)
stderr))))
(display-buffer buf))
(message "Babel evaluation exited with code %S" exit-code))