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

Re: Unset “zle_bracketed_paste” .zshrc



On Mon, 2020-01-27 at 14:01 +0000, Peter Stephenson wrote:
> On Sun, 2020-01-26 at 00:45 +0000, Daniel Shahaf wrote:
>>> Remember, you can use zmodload -F to manipulate which features
>>> are provided by a module, although not at the point of declaring
>>> autoloads --- some sort of autoloadable feature set might be another
>>> way of doing this.
>>
>> How do you envision this working?  Would there be, say, a zmodload flag
>> to add/remove entries from the default set of autofeatures?  Or would
>> «unset options» implicitly twiddle the autofeatures metadata for the
>> (not-yet-loaded) zsh/parameter module?
>
> I'd start by simply add the interface to zmodload itself, in the first
> instances.  That's already quite a job and not clear how useful it is.
> At the moment, until you can read the feature set from the module you're
> just guessing what the module provides.  The obvious fix is simply let
> the user claim e.g. module zsh/foo provides p:bar and complain if it
> doesn't when the module is loaded.

Duh.  We already have this --- "zmodload -Fa", and it's already
documented as fixing the problem that was bugging me --- don't
automatically load other features from the module as that can cause
unwanted side effects.  I'd completely forgotten implementing this.

% zmodload -Fa zsh/datetime p:EPOCHSECONDS
% print $EPOCHSECONDS
1580209515
% zmodload -Fl zsh/datetime
-b:strftime
+p:EPOCHSECONDS
-p:EPOCHREALTIME
-p:epochtime

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.  You can turn on and off the
feature as needed once the module is loaded.

pws



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