emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Ian Kelling <ianowl@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: stderr patch
Date: Sat, 22 Mar 2014 10:43:18 +0100	[thread overview]
Message-ID: <CALn3zoie8-X6FEa6TgBVV-FF=826OmZxH7uLzOMY6E8H7aTFHw@mail.gmail.com> (raw)
In-Reply-To: <532D0AB1.6080708@gmail.com>

Hi Ian

On Sat, Mar 22, 2014 at 4:59 AM, Ian Kelling <ianowl@gmail.com> wrote:
> I use babel mostly for shell scripts. I wrote a patch to allow toggling the
> handling of errors & std err. I prefer standard error just get printed with
> everything else, the same as calling a script from a terminal. Doing this properly
> with header arguments etc. has been discussed before (google org-babel stderr),
> and just hasn't gotten done yet. Until then, this works great, so I'm putting it
> out there in case anyone wants to use it.

I am generally concerned about respecting the exit status [1] and
stderr of a process, also in Org babel [2]. Thank you for taking care
of it.

> +(defcustom org-babel-use-error-buffer t
> +  "When evaluating a code block, if nil and an error is returned
> +,no error buffer is created and. Standard error
> +is redirected to standard out."
> +:group 'org-babel
> +:version "24.1"
> +:type 'boolean)

For two reasons I would much prefer if there would be not yet another
variable org-* but a header argument or a new value for e. g.
":results":
- When someone would use org-babel-use-error-buffer then sharing Org
  source blocks would be less easy.
- With a header argument it would be possible to have different
  behaviors in different Org source blocks which is also a requirement
  for backward compatibility of existing source blocks (I would want
  them to let babel execution still fail in case of a problem).

There are also use cases where I would want to capture stderr but let
babel execution fail when the exit status is non-zero, see [2].

Michael

[1] My shell prompt ($PS1) contains the exit status ($?), my shell
    scripts contain "set -o errexit; set -o pipefail".
[2] See my lengthy post here:
    http://thread.gmane.org/gmane.emacs.orgmode/45828/focus=46415

  parent reply	other threads:[~2014-03-22  9:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-22  3:59 stderr patch Ian Kelling
2014-03-22  8:45 ` Bastien
2014-03-22  8:50   ` Ian Kelling
2014-03-22  9:07     ` Bastien
2014-03-22  9:10       ` Ian Kelling
2014-03-22  9:23         ` Bastien
2014-03-22  9:43 ` Michael Brand [this message]
2014-03-22 10:58   ` Ian Kelling

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to='CALn3zoie8-X6FEa6TgBVV-FF=826OmZxH7uLzOMY6E8H7aTFHw@mail.gmail.com' \
    --to=michael.ch.brand@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ianowl@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).