all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <tomas@tuxteam.de>
To: emacs-orgmode@gnu.org
Subject: Re: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)
Date: Sat, 29 Oct 2022 08:14:04 +0200	[thread overview]
Message-ID: <Y1zErHo7lbwipn8q@tuxteam.de> (raw)
In-Reply-To: <87tu3njmv4.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 2360 bytes --]

On Sat, Oct 29, 2022 at 04:05:19AM +0000, Ihor Radchenko wrote:
> Rudolf Adamkovič <salutis@me.com> writes:
> 
> > Ihor Radchenko <yantar92@posteo.net> writes:
> >
> >> I do not think that it make sense to display that buffer when the code
> >> finishes successfully. I can see this kind of behaviour
> >> breaking/spamming automated scripts or export---code working in the
> >> past may throw error output into unsuspecting users.
> >
> > But the exit code has nothing to do with the standard error.

[...]

> > For example, I use a program for work that uploads data to a certain
> > 3rd-party server.  It exits with a zero code but also shows extremely
> > important notices on error output.  As an "unsuspecting user", if I used
> > Babel to run the program, I would end up in a trouble.

[...]

> Dear All,
> 
> As explained in the above quote, it may be reasonable to display stderr
> in the shell (and possibly other) src blocks upon execution.
> 
> + Stderr may contain important information even if the code block
>   succeeds
> - Displaying stderr will raise *Error* buffer, which may or may not be
>   expected or desired.
> 
> What do you think?

My take as an Org user is that this makes a lot of sense. I don't know
whether there is an elegant way to accomodate all the use cases in
an elegant way, but to provide a concrete example where I'd have found
it handy...

While preparing a handout for an introduction to shell programming
(at a very basic level), I wanted to embed little examples with
their results. Org rocks at this kind of task.

But in this case it's important to show everything the students are
going to see. One could argue that the error part is even the most
important.

So what I needed was not only the stderr (optionally somehow separated
from stdout -- optionally as someone would see it in some terminal
session), but also all the above even when the exit code was nonzero.

Ideally, a display of that exit code, too.

I ended up massaging prologue and epilogue, which worked nicely,
but sadly is language dependent for a set of concepts which are,
one could argue, independent of the language [1].

So yes, I would be thrilled by such a possibility.

Cheers

[1] These are OS conventions. So also a language of sorts, but at
another level.

-- 
tomás

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2022-10-29  6:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 15:14 Org 9.6-pre and Bash sessions Rudolf Adamkovič
2022-10-13 17:07 ` Michael Welle
2022-10-14  3:44 ` Ihor Radchenko
2022-10-15 20:56   ` Rudolf Adamkovič
2022-10-17  8:34     ` Ihor Radchenko
2022-10-21  5:29       ` Ihor Radchenko
2022-10-21 13:38         ` Rudolf Adamkovič
2022-10-22  4:22           ` Ihor Radchenko
2022-10-22  9:44             ` Rudolf Adamkovič
2022-10-22 10:59               ` Ihor Radchenko
2022-10-23  4:27                 ` Ihor Radchenko
2022-10-26 11:56                   ` Rudolf Adamkovič
2022-10-26 13:21                     ` Rudolf Adamkovič
2022-10-27  3:53                     ` Ihor Radchenko
2022-10-28 13:12                       ` Rudolf Adamkovič
2022-10-28 13:29                         ` Ihor Radchenko
2022-10-28 21:52                           ` Rudolf Adamkovič
2022-10-29  4:05                             ` [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions) Ihor Radchenko
2022-10-29  6:14                               ` tomas [this message]
2022-10-29  6:43                                 ` Samuel Wales
2022-10-29  9:00                                   ` tomas
2022-10-29  9:09                                     ` Ihor Radchenko
2022-10-29  9:18                                       ` tomas
2022-10-30  3:31                                         ` Ihor Radchenko
2022-10-30  6:11                                           ` tomas
2022-10-30  7:09                                             ` Ihor Radchenko
2022-10-30  8:18                                               ` tomas
2022-10-29 11:58                               ` Max Nikulin
2022-10-30  3:37                                 ` Ihor Radchenko
2022-10-30 20:28                               ` Tim Cross
2022-10-31  1:13                                 ` Org babel API (was: [FR] Display stderr contents after executing shell blocks (even when stdout :results output is requested) (was: Org 9.6-pre and Bash sessions)) Ihor Radchenko
2022-10-31  2:03                                   ` Tim Cross
2022-10-31  3:12                                     ` Ihor Radchenko
2022-10-29  4:05                             ` Org 9.6-pre and Bash sessions Ihor Radchenko
2022-11-03 16:30                               ` Rudolf Adamkovič
2022-11-04  2:52                                 ` Ihor Radchenko
2022-11-05  1:12                                   ` Rudolf Adamkovič

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1zErHo7lbwipn8q@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.