help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: "functions -c" and TRAPxxx
Date: Tue, 7 Jun 2022 07:57:55 -0700	[thread overview]
Message-ID: <CAH+w=7asDd+fxxcqg9c=DcKfo1gKSnuyL3PskX7Fdf192Hfwdg@mail.gmail.com> (raw)
In-Reply-To: <1148576327.671240.1654595869665@mail2.virginmedia.com>

On Tue, Jun 7, 2022 at 2:59 AM Peter Stephenson
<p.w.stephenson@ntlworld.com> wrote:
> > Creating a TRAPxxx function by "aliasing" to another function with
> > "functions -c" does not create the expected trap handler.
> I don't think there's any magic for this, it'll have to be ad hoc
> calls to settrap and unsettrap based on the function name.

Yes, but e.g. in exec.c there is a comment
                 * Remove the old node explicitly in case it has
                 * an alternative name
I know most of what's going on there, but "functions -c" is creating
an alternate name, and there is also the failure case of settrap()
returning nonzero to handle.

  reply	other threads:[~2022-06-07 14:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07  1:59 Bart Schaefer
2022-06-07  9:57 ` Peter Stephenson
2022-06-07 14:57   ` Bart Schaefer [this message]
2022-06-09  3:24     ` Bart Schaefer
2022-06-09  8:55       ` Peter Stephenson
2022-06-09 15:19         ` Bart Schaefer
2022-06-09 20:51           ` Bart Schaefer

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:

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

  git send-email \
    --in-reply-to='CAH+w=7asDd+fxxcqg9c=DcKfo1gKSnuyL3PskX7Fdf192Hfwdg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    --subject='Re: "functions -c" and TRAPxxx' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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).