From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17440 invoked from network); 12 Dec 2022 23:35:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Dec 2022 23:35:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670888138; b=hjm1yNpTjSHEJDqQm2/4x+pkZi1mLHDkTCaLEZXzH8r0eK0Ly/PI0kHWtcqDmAq2A0akJx70h3 1cT/zUgqrDrLidl3sdPCo6aAgrToKdtFub9Vqy4QTC90jLKQ6yjDCzCBMM50W0j80IW9S88J7Z 58ed4wQzNN15AFpzJqV7BdP2GNTlpQ3z0G8BXsaWpBqXal0bzP0Y5Ufet/50kQTGZFc1Yrrw5e kuby/iZdrv91c5LosTbBsgzQE1Do2/wCuc6gLabTzEXJkWPm6mA3dKSdRAlIsMtfR72qHlmy9N uzB1rQkyBsNGknW6PsXlXlMwv2Utgv5qxgpYfR6r+z5/Tg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vs1-f45.google.com) smtp.remote-ip=209.85.217.45; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1670888138; bh=q/0KEg0I2lzeki8kkMkm+YjAwZhhrPQjWStnAxKCCr0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=gorg/fkDrNvLBX8KQhxrh+IzIKzah44Z8qc8y7d4inzvGdz9EuALYKjTda541NzLj3gtp55vJR KfCXBBB43bl3dWvlDnWnSmM1bNOOxQZgn4Exn1cfO6df8cN/7ZWaB3zwnoas1XKK7wim0UbHHa WGOx4m8qYaAV8wWuQs84WamfzFJUZZRwHG6HVEjKM+xsxYD6yLHQrqvNQaJoQsZx9MiSkxdf3a NteI7P3Gz1URnQ/60f7879mJ4VeAaAzj9bQzrZVFEIpfplVPo7CsLxnR+xKwIr/1CwRkuClzCB G+uzl0jk3QMhsG0aHHDSjxj0qYkw7b/kU6crP6GsHpf8uw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Kzt9NoQa32wa3xhL8S+lydsCsiAyxKFH9SJMPj3KvNo=; b=aD10DK9vH1je/5M/39cq4nvngl q8wEUgkYVc3cAMwftyE+smjxh60yD27A7+LzrDi3VRF1Gpjt94dHACxWHwntRCpxosLgrmikUw1m9 4jGoOS4oy0z0M/72RHM6e8eu7KHPIVI+wa4wamqsbxR062rtoxHqLzaH3nBfWe4VfGK/GGwUhOkJV +E8PnDSt77lxTnifTL990x5/HS9A7TAgTlcuBHG/OBWG0Kko5O/FJV7GRplWr++gXzyIDJNWOhfNB 0/SFvU7g/20vEq0pLKPIsNCTDHGJzlHtn6hOjDSQ+XHUEbXug/WGHhJBzS4YpiHLZenkGg/hzI0PZ SoeX6blA==; Received: by zero.zsh.org with local id 1p4sKf-00089q-FJ; Mon, 12 Dec 2022 23:35:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vs1-f45.google.com) smtp.remote-ip=209.85.217.45; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vs1-f45.google.com ([209.85.217.45]:39560) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1p4sKQ-0007rY-Hm; Mon, 12 Dec 2022 23:35:23 +0000 Received: by mail-vs1-f45.google.com with SMTP id a66so4448369vsa.6 for ; Mon, 12 Dec 2022 15:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Kzt9NoQa32wa3xhL8S+lydsCsiAyxKFH9SJMPj3KvNo=; b=mTJZB03IPnL3tawzRUGbOe2lwgvkmiBK0OeDSLQsYsHAZYhjqoxV41KfphUSGTeOtH wvisEGxQ1P4dt/v48V+9lUyI/7jUKTKn8fo7A/tbFRckCoIHrS0v4zQSGKV3ReCuHiqv wXxNtbPCOO14KRDatiWpR3GHG62rYW8GhEAxVazD58OCQpxttSWdSa1clmNzZZzKTC4j y1HE0r4qGqwMsUTKdInML+odn5ezqrwPU10qi/P3/LsMk/ZqRhMT2UL2FFJUrn8msEY6 vnSXR0Y/cZLJ8sZCQyoXxOy6ltTcpZKB1GKRGtWiYoJrSkKjx5cI25xvbG/6PLqFi2S6 CFIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Kzt9NoQa32wa3xhL8S+lydsCsiAyxKFH9SJMPj3KvNo=; b=BzYKYHNt76hfoYUKdT6IH8MA1fyuMpOhhmcMn18y4O/mLYaWpR0pJixY9/NHoabrK9 bj7o7nwhUZc8O7yeHu6zSxpmMYrRtxSERCYPCxLw96tFz0ZTfjTLSf3hjg5hpnlKJ5xg SwSfrPOg145MAoN4/GGM8ky1LH06aM8Egqo/nIkv0GuSLlXJ3Gm3IQqdbN1BzP0R3aV/ tLrQCYyuurVz0vcfPaZO/LRf0TggJ2EMW7MjYYjqXwiAZFNA0rcwWv34jGlI1jCVdibz BI7okQRRiN/Vmi7iW6YURmmhcRGAKb1w7mG6wMPh8xjWdSPP3h8JYJBw4+JlNrH1Vuxl pHbQ== X-Gm-Message-State: ANoB5plnBChjKBP8WdWq5zosbRLKGrCMvshsbwA6n4ua3VMBTmnQzVa6 0spZM3cVw50rHTDDm6zyjEpr7Zcc+QIB1ld9LL8= X-Google-Smtp-Source: AA0mqf4Nth8GdA91pUTWmgP0iSNNwhEwDWytu5JwxaRlz/nABhIYjvtENmyMaUXbQhP62Ssi9UQLyH9n0kx+ChxJYDc= X-Received: by 2002:a05:6102:3da2:b0:3b5:f9a:7fae with SMTP id h34-20020a0561023da200b003b50f9a7faemr345799vsv.81.1670888121327; Mon, 12 Dec 2022 15:35:21 -0800 (PST) MIME-Version: 1.0 References: <5d0c4e22-80b0-2fd2-ee75-6902da52d121@eastlink.ca> <57e8e248-bb1a-663a-8557-e3fc13f671d4@eastlink.ca> <20221210113355.GW27622@tarpaulin.shahaf.local2> In-Reply-To: From: Philippe Altherr Date: Tue, 13 Dec 2022 00:35:10 +0100 Message-ID: Subject: Re: ERR_RETURN doc To: Bart Schaefer Cc: Daniel Shahaf , Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000ee658505efa9f464" X-Seq: 51197 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000ee658505efa9f464 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > The zsh manual is not rigorously enough written to be treated as a > "specification" and would become even less readable than Ray already > accuses it of being if we tried. I'd prefer to give a summary and > then reference the POSIX spec for details (but not via URL-link to it; > URLs tend to get stale). My proposed doc update covers most points. So much so that I didn't even feel the need to link to the POSIX doc. So no URL-link problem :-) Shouldn't docs of ERR_EXIT explicitly mention that =C2=AB! true=C2=BB does = not > cause an exit? This is implicitly covered by my proposed update. Philippe On Sun, Dec 11, 2022 at 2:24 AM Bart Schaefer wrote: > On Sat, Dec 10, 2022 at 6:12 AM Philippe Altherr > wrote: > > > > POSIX' "set -e" specification. That specification is quite a bit longer= . > Should Zsh's specification repeat all of that? Or should it link to it? > > The zsh manual is not rigorously enough written to be treated as a > "specification" and would become even less readable than Ray already > accuses it of being if we tried. I'd prefer to give a summary and > then reference the POSIX spec for details (but not via URL-link to it; > URLs tend to get stale). > > Aside, Martijn Dekker raised a related question back in workers/43874 > -- according to the POSIX chapter on Utilities > ( > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html= #tag_18_08_01 > ) > there are a bunch of circumstances where a non-interactive shell is > required to exit "as if the exit builtin were called". With ERR_EXIT, > interactive shells are also required to exit in those circumstances. > I'm pretty sure, though haven't re-tested, that zsh does not in fact > exit in some of those (such as a redirection error with a special > builtin) and in some of the cases where it does exit, it does not run > the SIGEXIT trap as implied by "as if the exit builtin" (that being > the actual reason for Martijn's message). > > And yes, I used a URL that might become stale, in this message. > Nobody is ever going to need or to be able to go through the archives > and fix that, whereas documentation would be expected to be kept up to > date, a burden I don't wish to impose. > --000000000000ee658505efa9f464 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The zsh = manual is not rigorously enough written to be treated as a
"specifi= cation" and would become even less readable than Ray already
accuse= s it of being if we tried.=C2=A0 I'd prefer to give a summary and
th= en reference the POSIX spec for details (but not via URL-link to it;
URL= s tend to get stale).

My proposed doc updat= e covers most points. So much so that I didn't even feel the need to li= nk to the POSIX doc. So no URL-link problem :-)

Shouldn't docs of ERR_EXIT e= xplicitly mention that =C2=AB! true=C2=BB does not
cause an exit?

This is implicitly=C2=A0covered by my proposed up= date.

Philippe


=


On Sun, Dec 11, 2022 at 2:24 AM Bart Schaefer <schaefer@brasslantern.com> wro= te:
On Sat, Dec = 10, 2022 at 6:12 AM Philippe Altherr
<philipp= e.altherr@gmail.com> wrote:
>
> POSIX' "set -e" specification. That specification is qui= te a bit longer. Should Zsh's specification repeat all of that? Or shou= ld it link to it?

The zsh manual is not rigorously enough written to be treated as a
"specification" and would become even less readable than Ray alre= ady
accuses it of being if we tried.=C2=A0 I'd prefer to give a summary and=
then reference the POSIX spec for details (but not via URL-link to it;
URLs tend to get stale).

Aside, Martijn Dekker raised a related question back in workers/43874
-- according to the POSIX chapter on Utilities
(https://pubs.= opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01)
there are a bunch of circumstances where a non-interactive shell is
required to exit "as if the exit builtin were called".=C2=A0 With= ERR_EXIT,
interactive shells are also required to exit in those circumstances.
I'm pretty sure, though haven't re-tested, that zsh does not in fac= t
exit in some of those (such as a redirection error with a special
builtin) and in some of the cases where it does exit, it does not run
the SIGEXIT trap as implied by "as if the exit builtin" (that bei= ng
the actual reason for Martijn's message).

And yes, I used a URL that might become stale, in this message.
Nobody is ever going to need or to be able to go through the archives
and fix that, whereas documentation would be expected to be kept up to
date, a burden I don't wish to impose.
--000000000000ee658505efa9f464--