From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: Bug or not a bug? dot expansion in ob-shell Date: Wed, 19 Feb 2020 20:43:58 +0100 Message-ID: References: <87eeur3p1p.fsf@ucl.ac.uk> <87a75eap8k.fsf@gnu.org> <87y2sy3kkl.fsf@ucl.ac.uk> <87r1yq4xiz.fsf@gnu.org> <875zg2kcy0.fsf@ucl.ac.uk> <87h7zmiw0v.fsf@gmail.com> <871rqqag19.fsf@bzg.fr> <87wo8iitzz.fsf@ucl.ac.uk> <87ftf63d79.fsf@gnu.org> <87pnear7tl.fsf@ucl.ac.uk> <87v9o236v1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000211b43059ef30316" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44007) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4VGX-0002xa-FL for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 14:44:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4VGW-0007hH-EN for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 14:44:13 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:43877) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4VGW-0007gn-1D for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 14:44:12 -0500 Received: by mail-wr1-x42f.google.com with SMTP id r11so1929045wrq.10 for ; Wed, 19 Feb 2020 11:44:11 -0800 (PST) In-Reply-To: <87v9o236v1.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Bastien Cc: Tim Cross , "emacs-orgmode@gnu.org" , "Fraga, Eric" --000000000000211b43059ef30316 Content-Type: text/plain; charset="UTF-8" I'm late to the discussion so I apologize in advance, but this fix seems counterintuitive to me. In my mind, for any shell code: - Return value: exit code of the last command - Output: whatever the commands print So to me, it's intuitive that =:exports value= would return the exit code of the last command, and =:exports output= would produce the output of the commands. I don't understand why a new option is needed. Am I missing something? --Diego On Wed, Feb 19, 2020 at 5:00 PM Bastien wrote: > I've implemented the suggestion I made in master: > > New option ~ob-shell-return-value-is-exit-status~ > > When set to =t=, consider the return value of a shell source code > block is the exit status of its last command. > > The default for this option is =nil=, i.e. the return value of a shell > block is the output of the commands. > > You can turn this on individual blocks by setting the header argument > =:value-is-exit-status= to =t=. > > Please test and let me know if it works. > > Thanks for bringing this up! > > -- > Bastien > > --000000000000211b43059ef30316 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm late to the discussion so=C2=A0I apologize in=C2= =A0advance, but this fix seems counterintuitive to me. In my mind, for any = shell code:

- Return value: exit code of the last comman= d
- Output: whatever the commands print

= So to me, it's intuitive that =3D:exports value=3D would return the exi= t code of the last command, and =3D:exports output=3D would produce the out= put of the commands. I don't understand why a new option is needed.

Am I missing something?

--Di= ego


On Wed, Feb 19, 2020 at 5:00 PM Bastien <bzg@gnu.org> wrote:
I've implemented the suggestion I ma= de in master:

=C2=A0 New option ~ob-shell-return-value-is-exit-status~

=C2=A0 When set to =3Dt=3D, consider the return value of a shell source cod= e
=C2=A0 block is the exit status of its last command.=C2=A0

=C2=A0 The default for this option is =3Dnil=3D, i.e. the return value of a= shell
=C2=A0 block is the output of the commands.

=C2=A0 You can turn this on individual blocks by setting the header argumen= t
=C2=A0 =3D:value-is-exit-status=3D to =3Dt=3D.

Please test and let me know if it works.

Thanks for bringing this up!

--
=C2=A0Bastien

--000000000000211b43059ef30316--