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

Re: Unset “zle_bracketed_paste” .zshrc



On Thu, 2020-01-23 at 03:12 +0000, Daniel Shahaf wrote:
> I haven't tried to implement this yet, but what I have in mind is
> (1) Make unsetparam_pm() add the PM_UNSET bit if the PM_AUTOLOAD bit is
> present; (2) Make module loading, before creating a parameter, check if
> there's a Param with PM_UNSET and PM_AUTOLOAD both set; if there is,
> rather than create the "real" parameter, delete the tombstone parameter.
> (But if there isn't a Param at all, the module _should_ create its special
> Param anyway, to allow modules to be unloaded and reloaded in the same
> shell session.)

The obvious expected behaviour would be for it to have the same
behavious as unsetting the parameter after the module is loaded.  But a
quick tests suggests that doesn't work for readonly parameters, for one
--- all that would happen is that would produce an error when the module
is loaded, which doesn't really make much sense.  So in that case, at
least, the behaviour above is as logical as anything.

Documenting the current behaviour is perfectly respectable.  The
autoload flag effective means the parameter behaviour defers to the
module.  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.

pws



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