From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 9e96201d for ; Thu, 6 Feb 2020 12:41:20 +0000 (UTC) Received: (qmail 13381 invoked by alias); 6 Feb 2020 12:41:10 -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: 45385 Received: (qmail 13390 invoked by uid 1010); 6 Feb 2020 12:41:10 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25713. spamassassin: 3.4.2. Clear:RC:0(66.111.4.28):SA:0(-2.6/5.0):. Processed in 4.603911 secs); 06 Feb 2020 12:41:10 -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: gggruggvucftvghtrhhoucdtuddrgedugedrheefgdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfgjfhfogggtgfesthhqtd dtredtjeenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghnihgv lhdrshhhrghhrghfrdhnrghmvgeqnecukfhppeejledrudektddrheejrdduudelnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdrshesuggr nhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Date: Thu, 6 Feb 2020 12:40:23 +0000 From: Daniel Shahaf To: Subject: Re: Unset =?UTF-8?B?4oCcemxlX2JyYWNrZXRlZF9wYXN0ZeKAnQ==?= .zshrc Message-ID: <20200206124023.450ee3f3@tarpaulin.shahaf.local2> In-Reply-To: <1580297021.5380.17.camel@samsung.com> References: <0723EF0A-BD62-4C2C-AAA1-735AD3D64768@icloud.com> <20200123031249.034c7e1a@tarpaulin.shahaf.local2> <1579773213.5343.1.camel@samsung.com> <20200126004519.6e44ae68@tarpaulin.shahaf.local2> <1580133672.4960.15.camel@samsung.com> <1580209759.6442.3.camel@samsung.com> <1580297021.5380.17.camel@samsung.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 Peter Stephenson wrote on Wed, 29 Jan 2020 11:23 +0000: > On Tue, 2020-01-28 at 11:09 +0000, Peter Stephenson wrote: > > % zmodload -Fa zsh/datetime p:EPOCHSECONDS > > % print $EPOCHSECONDS > > 1580209515 > > % zmodload -Fl zsh/datetime > > -b:strftime > > +p:EPOCHSECONDS > > -p:EPOCHREALTIME > > -p:epochtime > >=20 > > This is another way of fixing the underlying problem --- e.g. here > > you don't need to "unset EPOCHREALTIME" because it wasn't provided > > as a feature in the first place. =C2=A0You can turn on and off the > > feature as needed once the module is loaded. =20 >=20 > I see parameters used by ZLE are only fairly weakly linked into this > mechanism, however. =C2=A0At least one reason for that is because of the > unhelpfully tight linkage between ZLE and the main shell, so it's > not simply a straightforward plugin. =C2=A0However, I haven't looked > further so I don't know if that's an issue with zle_bracketed_paste. > There may be some scope for rationalisation. >=20 zle_bracketed_paste isn't declared special; it's just getaparam()'d in the guts of a random C function. > Loading a module for your own purposes --- for which Sebastian > no doubt provides a good deal of support --- is in any case a > rather different thing from the shell loading a module to provide > its own basic features, so this may not be going anywhere particularly > useful in this case. Well, it's an option. It would result in the following interface: to prevent $zle_bracketed_paste from being defined one will have to run =C2=ABunset zle_bracketed_paste=C2=BB if zsh/zle has been loaded, or =C2=AB= zmodload -Fa zsh/zle -p:zle_bracketed_paste=C2=BB otherwise. On the other hand, the approach I described in 45339 aimed to make it possible to just do =C2=ABunset zle_bracketed_paste=C2=BB to unset that par= ameter (and keep it unset), regardless of whether zsh/zle has or hasn't been loaded. I find the latter option preferable. (Assuming it can be implemented without errors about readonly parameters cropping up at unexpected times, as discussed upthread) In the meantime, here's a test for -Fa. diff --git a/Test/V01zmodload.ztst b/Test/V01zmodload.ztst index 1bd8c1900..6a4e34d2d 100644 --- a/Test/V01zmodload.ztst +++ b/Test/V01zmodload.ztst @@ -348,6 +348,20 @@ ?(eval):6: unknown function: systell ?(eval):9: file descriptor out of range =20 + $ZTST_testdir/../Src/zsh -fc ' + zmodload zsh/zutil + zmodload -Fal zsh/zutil | grep parse + zmodload -u zsh/zutil + # + zmodload -Fa zsh/zutil -b:zregexparse + zmodload zsh/zutil + zmodload -Fal zsh/zutil | grep parse >&2 + ' +0:zmodload -Fa can disable features from being loaded +>b:zparseopts +>b:zregexparse +?b:zparseopts + %clean =20 eval "$deps" Sorry for the delays responding to this thread; life has been getting in the way. Daniel