Rudolf Adamkovič <salu...@me.com> writes: > Thank you for investigating, explaining, and also fixing the problem! I > pulled the latest 'main' and everything works a bit, it seems. > > Then, to avoid walking in circles, I decided to write some tests, for I > think shell blocks should never, never, never break in such basic ways, > let alone in production Emacs.
Thanks! I will not look much into details of the patch for now. Let's discuss the general expectations from shell blocks first. You seem to be missing several things described in the documentation. > I noticed that the following tests do not pass: > > 1. ob-shell/error-output-after-success > > We seem to trash error output, such as warnings, on success. I think > we should not do this. Now, on the execution of "echo X &>2", Org > says "Code block produced no output." But that does hold true. The > block did produce output, just on the other output stream, namely > error output. Trashing error output is expected by default. I suggest you to read through https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-shell.html The default :results argument is output, which implies: output returns stdout, default As expected, stdout is empty in your example. ob-shell follows the spec here. Another question is if users may want to obtain strerr in some cases. A new feature like :results stderr might be implemented. Though users can already do the usual 2>&1 to merge stderr into stdout. > 2. ob-shell/error-output-after-failure > > We seem not to show the exit code in this case. Why? Exit code was not shown in the past until my commit https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ab7eff9d9c0968392bd9783d72c56a4023bd10be I guess that showing the error code unconditionally (when exit code is non-0) could be an option. Now done in https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d87a496b54b502d98e49f8bd6596e0562be9d105 > 3. ob-shell/exit-codes > > Should we add a newline after the exit code message? Done. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>