]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
org-mode ob-eval org-babel-eval-error-notify fix
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Thu, 5 Jan 2023 10:55:31 +0000 (11:55 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Thu, 5 Jan 2023 10:55:31 +0000 (11:55 +0100)
display message only if error is not 0.
would be nice to have a toggle variable for that.

Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
elpa/org-9.6/ob-eval.el

index f57566079d729069996bd2da23d3978171d63bfd..b379264e1489e24a0510ee0d0539d6d5f385a1aa 100644 (file)
 
 (defun org-babel-eval-error-notify (exit-code stderr)
   "Open a buffer to display STDERR and a message with the value of EXIT-CODE."
-  (let ((buf (get-buffer-create org-babel-error-buffer-name)))
+  (if (> exit-code 0)
+      (let ((buf (get-buffer-create org-babel-error-buffer-name)))
     (with-current-buffer buf
       (goto-char (point-max))
       (save-excursion
         (unless (bolp) (insert "\n"))
         (insert stderr)
         (insert (format "[ Babel evaluation exited with code %S ]" exit-code))))
-    (display-buffer buf))
+    (display-buffer buf)))
   (message "Babel evaluation exited with code %S" exit-code))
 
 (defun org-babel-eval (command query)