Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: ZSH_XTRACEFD variable
- X-seq: zsh-workers 45763
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Feature request: ZSH_XTRACEFD variable
- Date: Sun, 3 May 2020 00:06:58 +0000
- Cc: Timothée Mazzucotelli <timothee.mazzucotelli@xxxxxxxxx>, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- In-reply-to: <CAH+w=7Ymtz4XH708BGvgwo89WNB=HttfyX+fHVHakz+Ybf==ag@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <EL9xNuAdKSLWp41th3XxhRLVtul7jHkT9ons2s2c_35aNjCbCMzo4DqiCNV1SoNjdLhNgdUGLNMHQxQ9q4jDMcNIsxzonWx5jzOB5Hr8rBs=@protonmail.com> <20190518075514.hbygmb5dl5wz23h5@chaz.gmail.com> <20190520103444.qyih7lvoigvf3rfx@chaz.gmail.com> <CGME20190721150914epcas1p18b5b4b9ccc4e593e854b076a835257c7@epcas1p1.samsung.com> <CAD8ZDTrfrWTKfa1efTo63uk1XJO4BOp5hSLOfjL1tXkeDMf_QQ@mail.gmail.com> <1563722540.4311.24.camel@samsung.com> <CAD8ZDTokqOTfEajquX2SKU5pLWgd85sPdRMYkxE4nF0pQhi+BA@mail.gmail.com> <1565710707.5633.11.camel@samsung.com> <CAD8ZDTotCLBANtzppSbCcgKyLhkXaVWysjqv99xS6bnLypBViA@mail.gmail.com> <309829031.4459446.1587391766024@mail2.virginmedia.com> <CAD8ZDTp=rYsWiEkq3byjU=BRAA2iLwxt5QG_19MBc+Jo8dC-0w@mail.gmail.com> <CAH+w=7Ymtz4XH708BGvgwo89WNB=HttfyX+fHVHakz+Ybf==ag@mail.gmail.com>
Bart Schaefer wrote on Sat, 02 May 2020 14:15 -0700:
> On Sat, May 2, 2020 at 11:03 AM Timothée Mazzucotelli
> <timothee.mazzucotelli@xxxxxxxxx> wrote:
> >
> > How to make sure the file descriptor of a local ZSH_XTRACEFD is closed when
> > leaving the function scope?
> > Or, how to make sure a local ZSH_XTRACEFD is unset when leaving the
> > function scope?
>
> I think you're going to have to declare ZSH_XTRACEFD to be a "special"
> variable, with all the extra plumbing that entails.
It's already special, via the IPDEF5() macro.
The end-of-scope processing happens in scanendscope(). If the
parameter weren't special, unsetparam_pm() would be called and would
call the unsetfn. However, the codepath for (non-removable) specials
doesn't call the unsetfn; it just calls the setfn again.
I would have expected the unsetfn to be called for any special parameter.
Cheers,
Daniel
P.S. Shouldn't ZSH_XTRACEFD be declared with PM_DONTIMPORT?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author