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=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5843 invoked from network); 9 May 2020 15:42:55 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 9 May 2020 15:42:55 -0000 Received: (qmail 13953 invoked by alias); 9 May 2020 15:42:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45800 Received: (qmail 2786 invoked by uid 1010); 9 May 2020 15:42:50 -0000 X-Qmail-Scanner-Diagnostics: from out5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25801. spamassassin: 3.4.4. Clear:RC:0(66.111.4.29):SA:0(-1.1/5.0):. Processed in 0.64145 secs); 09 May 2020 15:42:50 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeehgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkjghfofggtgfgsehtjedttdertddvnecuhfhrohhmpeffrghnihgv lhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpeefudetgeevhedvhfetveetvdduleduieejueduueejjedtteeu tdejhfdtgfeiteenucfkphepuddtledrieeirdduhedrvdefleenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhh rghhrghfrdhnrghmvg X-ME-Proxy: Date: Sat, 9 May 2020 15:42:10 +0000 From: Daniel Shahaf To: Peter Stephenson Cc: Zsh hackers list Subject: Re: local_traps doesn't restore traps set from functions Message-ID: <20200509154210.401d82d9@tarpaulin.shahaf.local2> In-Reply-To: <1305621354.302160.1589037862169@mail2.virginmedia.com> References: <20200507212136.3ff1a843@tarpaulin.shahaf.local2> <1305621354.302160.1589037862169@mail2.virginmedia.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Peter Stephenson wrote on Sat, 09 May 2020 16:24 +0100: > > On 07 May 2020 at 22:21 Daniel Shahaf wrote: > > Roman Perepelitsa wrote on Wed, 06 May 2020 15:31 +0200: > > > It appears that local_traps doesn't restore traps that were originally > > > set from functions. > > > > Precisely. > > > > The following patch fixes it: > > OK, so the point here is that in this case the trap we're fiddling with > is not going out of scope, nor having something else restored over it, > it just happens to have been created inside a function. At this > point, that fact becomes irrelevant, so we simply massage the information > to make it behave as if it had been created at the current (new) function > depth. > > That seems fine --- my only comment would be it would probably be sensible > to insert some edited version of the previous paragraph as I for one > am almost certain to wonder what's going on if I encounter this code > in the future. Will do. Thanks for the review! Daniel