Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "functions -c" and TRAPxxx



On Tue, Jun 7, 2022 at 2:59 AM Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> 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.




Messages sorted by: Reverse Date, Date, Thread, Author