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 22578 invoked from network); 3 May 2020 21:07:18 -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 21:07:17 -0000 Received: (qmail 29504 invoked by alias); 3 May 2020 21:07:05 -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: 45773 Received: (qmail 7085 invoked by uid 1010); 3 May 2020 21:07:05 -0000 X-Qmail-Scanner-Diagnostics: from out5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25801. spamassassin: 3.4.4. Clear:RC:0(66.111.4.29):SA:0(-1.1/5.0):. Processed in 4.501302 secs); 03 May 2020 21:07:05 -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: gggruggvucftvghtrhhoucdtuddrgeduhedrjedvgdduheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkjghfofggtgfgsehtje dttdertddvnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggrnhhi vghlrdhshhgrhhgrfhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeefudetgeevhedvhf etveetvdduleduieejueduueejjedtteeutdejhfdtgfeiteenucfkphepuddtledrieei rdduhedrvdefleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Date: Sun, 3 May 2020 21:06:18 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: Feature request: ZSH_XTRACEFD variable Message-ID: <20200503210618.5c639014@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> <20200503000658.6fddb904@tarpaulin.shahaf.local2> 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=US-ASCII Content-Transfer-Encoding: 7bit Peter Stephenson wrote on Sun, 03 May 2020 20:54 +0100: > On Sun, 2020-05-03 at 06:43 +0200, Roman Perepelitsa wrote: > > On Sun, May 3, 2020 at 2:07 AM Daniel Shahaf wrote: > > > > > > I would have expected the unsetfn to be called for any special parameter. > > > > I've bumped into a similar issue with LC_* parameters. Here are a > > couple of test cases: > > > > 1. > > > > ( > > unset -m 'LC_*|LANG' > > export LC_CTYPE='en_US.UTF-8' # set this to any UTF-8 locale you have > > echo '\u276F' # this works > > () { > > local LC_ALL=C > > } > > echo '\u276F' # this doesn't work > > ) > > > > 2. > > > > ( > > unset -m 'LC_*|LANG' > > LC_COLLATE=en_US.UTF-8 > > x=(-a --b) > > print -r -- ${(on)x} # this prints "-a --b" > > () { > > local LC_ALL= LC_COLLATE=C > > print -r -- ${(on)x} > > } > > print -r -- ${(on)x} # this prints "--b -a" > > ) > > Something like the attached? Slightly but not extensively tested, so I could easily > have missed something. Confirmed it fixes Roman's case (1). When LC_ALL is unset, the patch calls setlocale() for all known locale categories (LC_*), not only for the ones that changed, like langsetfn() and lcsetfn() do. Is this a problem? (I guess there was a reason langsetfn() and lcsetfn() weren't implemented to begin with via the if/else/for combination you just wrote.) I had in mind a different approach: I thought of having scanendscope() call unsetfn for (some subset of?) special parameters and having LANG and LC_* use a custom unsetfn rather than the default one. Even if this is sensible, we can leave it for future work, though; I wouldn't want to make the perfect the enemy of the good. Cheers, Daniel