From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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.2 Received: (qmail 16263 invoked from network); 3 May 2020 00:07:59 -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; 3 May 2020 00:07:59 -0000 Received: (qmail 8833 invoked by alias); 3 May 2020 00:07:47 -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: 45763 Received: (qmail 11824 invoked by uid 1010); 3 May 2020 00:07:47 -0000 X-Qmail-Scanner-Diagnostics: from wout4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25793. spamassassin: 3.4.4. Clear:RC:0(64.147.123.20):SA:0(-1.1/5.0):. Processed in 4.405119 secs); 03 May 2020 00:07:47 -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: gggruggvucftvghtrhhoucdtuddrgeduhedrjedtgddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkjghfofggtgfgsehtqhdttdertdejnecuhfhrohhmpeffrghnihgv lhcuufhhrghhrghfuceougdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenuc ggtffrrghtthgvrhhnpefhtdetfeehveeutdehuddtieefgeettedtjedtffehudeiieej leetteekudetheenucfkphepuddtledrieeirdduhedrvdefleenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhh rghhrghfrdhnrghmvg X-ME-Proxy: Date: Sun, 3 May 2020 00:06:58 +0000 From: Daniel Shahaf To: Bart Schaefer Cc: =?UTF-8?B?VGltb3Row6ll?= Mazzucotelli , Peter Stephenson , "zsh-workers@zsh.org" Subject: Re: Feature request: ZSH_XTRACEFD variable Message-ID: <20200503000658.6fddb904@tarpaulin.shahaf.local2> In-Reply-To: References: <20190518075514.hbygmb5dl5wz23h5@chaz.gmail.com> <20190520103444.qyih7lvoigvf3rfx@chaz.gmail.com> <1563722540.4311.24.camel@samsung.com> <1565710707.5633.11.camel@samsung.com> <309829031.4459446.1587391766024@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=UTF-8 Content-Transfer-Encoding: quoted-printable Bart Schaefer wrote on Sat, 02 May 2020 14:15 -0700: > On Sat, May 2, 2020 at 11:03 AM Timoth=C3=A9e Mazzucotelli > 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? =20 >=20 > 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?