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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13373 invoked from network); 10 Dec 2022 11:32:59 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Dec 2022 11:32:59 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670671979; b=rgzjb0zTSRTZL2L3HrMQ1Kp6ryIWsQbQHrL0+TcAi6il6TwmFAc/6qQb1hSDmZ6Qzfb96HtDRN Iat/p0fIPitf7RaZvdEpubgsLv4kiccSazYVGKkMytKf9dVOnuD7g5YumaCWZ7zkAU0q/PpODG 7p/CjEs8Qp9rh0w4WJUOt1dT/5s62b1eihKwlmkSozwg5R+vrGtvnUfyX0x9oTeL6MwpXy7jKg +2eeU2aSqquOob4qNW2Psm/ACHSjDXC4AGMMPDSPXbjjd5Jt1EZAAaGICQBB+oB5zdEpx5ceFY 6KpqwlMrAKkUtGusz6hylS4ZjnH2cDwg/Nw3ArAK8deHIQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out5-smtp.messagingengine.com) smtp.remote-ip=66.111.4.29; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1670671979; bh=5+pJgAqGhzaTyXqFIknEMP/7Z0oRVDiZHd4rqgl2118=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=FfTIaE/IwG7/ltGWvfDoiz9MJLvOYXp7nNVyos0nm+44tbt+i27O+dW2ujIZJRkjBHL3C3gsBb zhA8MrMLlKrZarGs//Bi+kAzKcxz0qhyPrPhj6duNnGUpV48moHp+WGUAI+m++Ny5ClKNOa4x1 L7wP9NCIjj/vImUFqHEVcI3aCB9H01mFpPCdXo6xq3fDwWzqrR14sjNmV12tnXoylY2NSyGV/L QGJRgMuomFqMHqJJADPoo03qSkH8hrHyOlOqQwLNXBDNzUGsmzqQ4nCrjB8lZUftfB9HuV3wRm Bu2NmMGOSx9mm41LlbL0ROYo6VZA6T8l2RCQonki7L2Bog==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=bHWg0aRCtvUt8gMQto5rhVxt2H9hBC7OsdlPAuJX33g=; b=Uvo9zawFoKuxLa6Qj2PibHFFtV WPjhFNth5BG4pTw5nP7IYgg6cx71ZmwllrHFurljjRustQwvKf53BpceVSc1rNM1Z3Oe5xVg215mA ZwfuhUGo8hsT5pIl2+Gf7qudBciuULcLVhVFNcs+F9TV+Dklsx2YJ6zDqD92Z7KzInhWk3QIqFwAF hsbNCdBnmZy76lt5rENf61ZBkiY+oTp3BopSYjxeprzGsgrB2XxT1xn372DfH+Uc50n2iHGbQ1vmO CRKmSzOrWlhXInVYZE3Tw3wmEVhFaxtS3+105Lsm2RNUJ4t+bpcpICCwaHDrP795NVWt5EXyNRe0H cQa1/WbA==; Received: by zero.zsh.org with local id 1p3y6E-000ME7-LP; Sat, 10 Dec 2022 11:32:58 +0000 Authentication-Results: zsh.org; iprev=pass (out5-smtp.messagingengine.com) smtp.remote-ip=66.111.4.29; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out5-smtp.messagingengine.com ([66.111.4.29]:46387) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1p3y5d-000LwI-Ll; Sat, 10 Dec 2022 11:32:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4061B5C006B; Sat, 10 Dec 2022 06:32:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 10 Dec 2022 06:32:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1670671939; x=1670758339; bh=bHWg0aRCtv Ut8gMQto5rhVxt2H9hBC7OsdlPAuJX33g=; b=lyj4eW+ahJyFf1RRmUX3l8AQF5 tckxlEodUMgCGhTQabaRQpyVKEDyGr9hbR4qGdEqNyMrl3F117vKlj1zuUBOf7GO 5y2gV+dQ7zna+Eb9QPxo2020tLusnK0PTc22tGRsicYzcjjCpI4ftAEQivbwm1Eg X9HNJPWQUtdkh0aoFGFSrSHX+Qj7BMNtQrdNxOp4i+y/teMsf9CvnOAJ8l0CpKeq XGr4zVmVmFRfhVkvZXcRztQiwe5FhEoKgZBOhb7gKTADoZLIZdiTyLRrmqKpiEh9 zLsvURnjObNXd6vQTDgJyz2/Px55XkHlj2FcLOPV1/d8KHLAEmI95ewmm8eA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1670671939; x= 1670758339; bh=bHWg0aRCtvUt8gMQto5rhVxt2H9hBC7OsdlPAuJX33g=; b=J SKwOXBIhIsxCudiF/PugxfCECc4kq55s/Vk829rjjs/aZsuwzcrG7gC0X8LNHgA7 YkJU3M6MvxiCdh3h/8+biuCS4FwQeK+aFs+KCkKxz6vHKYxk+2qGxQpxd/2V6JDo +ZwLczP838c9k/1tHY0EX/rhWGddFUgAYlIEfFXL4nVT9yqd/4dhqnGjdJ2h5Lr/ 1H6CGuJ4AWt+g7DaUbZArqDUqCvHy/wueXeS4hbLk8lIW5RnsP4cixN/fwKLzkio S3+bHU4a8alZ96P96I4U89BH5EALlS7gY9lv7qh0Z4sEfXZHVRmzQEpXpqMYWuIn JDR0XHzLwSKaqjIxhNIDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeggddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtugfgjggfsehtkedttddtreejnecuhfhrohhmpeffrghn ihgvlhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeehtdefudelteejueefjeelgedvtedvtdehhfffjefggfeu heetheduueekuefhheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Feedback-ID: i425e4195:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Dec 2022 06:32:18 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4NTm2Q1F0cz3BB; Sat, 10 Dec 2022 11:32:14 +0000 (UTC) Date: Sat, 10 Dec 2022 11:32:14 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Cc: Philippe Altherr Subject: Re: [PATCH] NEWS item about the ERR_EXIT fixes Message-ID: <20221210113214.GV27622@tarpaulin.shahaf.local2> References: <46fcb939-0ed9-4b51-959d-67339181e3e3@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <46fcb939-0ed9-4b51-959d-67339181e3e3@app.fastmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 51167 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: Lawrence Velázquez wrote on Fri, Dec 09, 2022 at 01:44:44 -0500: > On Thu, Dec 8, 2022, at 7:24 PM, Bart Schaefer wrote: > > On Thu, Dec 8, 2022 at 1:47 PM Philippe Altherr > > wrote: > >> > >> I couldn't make it shorter than what is in the patch. > > > > I think this is fine. Any opposed? > > I think it's overly verbose; NEWS doesn't have to explain how > ERR_EXIT works. Here's a possible alternative: > > diff --git a/NEWS b/NEWS > index cdafd1ff5..d8b8687c0 100644 > --- a/NEWS > +++ b/NEWS > @@ -4,8 +4,27 @@ CHANGES FROM PREVIOUS VERSIONS OF ZSH > > Note also the list of incompatibilities in the README file. > > -Changes since 5.8.1 > -------------------- > +Changes since 5.9 > +----------------- > + > +The ERR_EXIT option was refined to be more self-consistent and better > +aligned with the POSIX-2017 specification of `set -e`: > + > + - Prefixing a function call or anonymous function with `!` now > + suppresses ERR_EXIT. Shouldn't this define the term "suppresses"? It's not used in the documentation of ERR_EXIT. Is the option suppressed for the function call or the result of the anonymous function, or /within/ the called function or anonymous function? What's the behaviour of ERR_EXIT on «! foo» when foo isn't a named or anonymous function? I.e., does the change make function calls an exception, or does it make them /no longer/ an exception? I think the text should answer this. > + > + - The `always` command now propagates ERR_EXIT suppression, as other > + complex commands do. > + Shouldn't this define the term "propagates"? It's not used in the documentation of ERR_EXIT. > + - Function calls, anonymous functions, and the `eval`, `.`, and > + `source` commands no longer propagate ERR_EXIT suppression. s/commands/builtins/ > + > +The ERR_RETURN option is now suppressed when a function containing > +a compound sublist (`&&` or `||`) is called from within another compound > +sublist. > + Does suppression happen for the result of the call, or within the callee? What exactly are the conditions whereupon suppression happens? As written, the text implies that suppression happens in . FWaCL() { …; if false; then : && :; fi; … } false || FWaCL . regardless of the values of the ellipses; is that the intended meaning? As you mentioned downthread, please add examples of affected cases (and, if needed, of unaffected cases too). Doc/Zsh/ can be updated as well, if needed (this is discussed on the 51089 thread). Proposed text (possibly wrong, do not use it without checking for correctness and omissions): The ERR_EXIT option no longer applies to the result of commands of the form '! foo' regardless of what 'foo' is. Previously, the option did take effect if 'foo' were a function call or an anonymous function. Example: . setopt ERR_EXIT f() { false } g() { ! f; echo This will be printed in 5.10 but was not printed in 5.9 } The ERR_EXIT option now applies to the result of an 'always' block. This aligns 'always' with other complex commands. Example: . setopt ERR_EXIT { false } always { echo This would be printed by either 5.9 and 5.10 } echo This would only be printed by 5.10 and newer # I'm saying "complex" rather than "compound" because that's the # term the manual uses. The ERR_EXIT option now applies to the results of function calls, anonymous functions, and the `eval`, `.`, and `source` builtins. Example: . setopt ERR_EXIT f() { false; } f echo This was printed under 5.9 but will not be printed by 5.10 The ERR_RETURN option now applies within a function even if the return code of the function itself would not trigger ERR_RETURN behaviour from the function's caller (e.g., because the function call is on the left-hand side of an "&&" or "||"). Example: . setopt ERR_RETURN f() { false; echo This was printed under 5.9 but will not be printed under 5.10 } g() { f || true } Cheers, Daniel P.S. Personally, I'd have preferred it if the four commits with "51001:" at the start of their log message had something unique there, e.g., "51001/{1..4}", as per precedent (e.g., zsh-5.8-433-ga23f19bfb). Rationale: so anyone doing «git log --grep='^51001'» would know, from the first log message they see, that several commits match the grep, rather than just one as might be assumed. > +Changes from 5.8.1 to 5.9 > +------------------------- > > zsh 5.9 is dedicated to the memory of Sven Guckes, who was, amongst other > things, a long-time zsh advocate. For more information, see: > -- > vq >