emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug or not a bug? dot expansion in ob-shell


From: Tim Cross
Subject: Re: Bug or not a bug? dot expansion in ob-shell
Date: Thu, 20 Feb 2020 00:15:48 +1100
User-agent: mu4e 1.3.8; emacs 27.0.60

Hi Bastien,

I'm not sure - need to think about it some more and go back through the
manual. My initial feeling is that the example block you show should
only return "Hello!" when you request output as the reuslts and
otherwise return the return value of echo (which is the exit code in
this case).

The main problem with the additional variable you propose is that you
would only want it enabled on some source blocks and not others, so it
might need to be settable as a header option to turn it on/off for a
specific block.

Bastien <address@hidden> writes:

> Hi Tim,
>
> thanks for your proposal.  I think we agree here.
>
> My suggestion is to have a new option ob-shell-value-is-exit-status.
>
> When set to nil (the default), the "return value" of a shell source
> block would be the output of the last command.  This is the current
> behavior where we have e.g.
>
>   #+begin_src shell
>   echo "Hello!"
>   #+end_src
>
>   #+RESULTS:
>   : Hello!
>
> When set to t, the return value of a shell source block would be the
> exit code of the last command.  This would be useful for side effect
> and other use cases.
>
> We can also consider a specific parameter :value-is-exit-code to set
> for individual blocks--useful for noweb.
>
> My only point is I don't think ob-shell-value-is-exit-status should be
> t by default, as it would cause all shell blocks to return the status
> code by default, which may not be what most users want.
>
> Anyway, I don't have yet a clue on how to add this new option.  I'll
> leave it to Eric first (if he has time) then look at it later this
> week.
>
> Thanks!


--
Tim Cross



reply via email to

[Prev in Thread] Current Thread [Next in Thread]