zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: local_traps doesn't restore traps set from functions
Date: Sat, 9 May 2020 15:42:10 +0000	[thread overview]
Message-ID: <20200509154210.401d82d9@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <1305621354.302160.1589037862169@mail2.virginmedia.com>

Peter Stephenson wrote on Sat, 09 May 2020 16:24 +0100:
> > On 07 May 2020 at 22:21 Daniel Shahaf <d.s@daniel.shahaf.name> 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

  reply	other threads:[~2020-05-09 15:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 13:31 Roman Perepelitsa
2020-05-07 21:21 ` Daniel Shahaf
2020-05-08  6:51   ` Roman Perepelitsa
2020-05-09 14:14     ` Daniel Shahaf
2020-05-09 15:24   ` Peter Stephenson
2020-05-09 15:42     ` Daniel Shahaf [this message]
2020-05-09 19:51       ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200509154210.401d82d9@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).