zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: Unset “zle_bracketed_paste” .zshrc
Date: Mon, 27 Jan 2020 14:01:12 +0000	[thread overview]
Message-ID: <1580133672.4960.15.camel@samsung.com> (raw)
In-Reply-To: <20200126004519.6e44ae68@tarpaulin.shahaf.local2>

On Sun, 2020-01-26 at 00:45 +0000, Daniel Shahaf wrote:
> > 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.
> In what case would an error happen upon loading of the module?
>
> The only error I see is this:
> 
>     % zsh -fc 'unset builtins; zmodload zsh/parameter'
>     %
> 
>     % zsh -fc 'zmodload zsh/parameter; unset builtins' 
>     zsh:1: read-only variable: builtins
>     zsh: exit 1     zsh -fc 'zmodload zsh/parameter; unset builtins'
>     % 
> 
> And I think it makes sense, because trying to unset a non-autoloadable
> readonly parameter gives the same error.

The worry is simply that this happens on any autoload to that module,
which may be triggered by a completely different parameter; you then see
this message about a parameter that's got nothing to do with the
operation that's actually taking place.

So if does what you expect, so long as you don't expect it to be
seamless and with no possible confusion :-).

> > [...] The autoload flag effective means the parameter behaviour defers to
> > the module.
> In other words, the rule is a parameter should only be unset by
> explicitly calling the «unset» builtin; loading and unloading the module
> doesn't affect the parameter's existence.  Thanks, this makes sense.
> 
> How about the following spec? —

Those look sensible --- which I think is all we can ask for, I don't see
any hard and fast rules coming down from on high.  <Peers quickly upwards>

> > Documenting the current behaviour is perfectly respectable.
> We could do this for 5.8, 
> but I'd like to take a shot at the
> general case too.  (Though I already have a backlog of patches I want to
> finish, or in some cases start.)

I'm not going to argue, either way.

> > 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.

Any consequent interaction between parameter- or other feature-specific
code would then be a further issue on top of that.  So if the above
already looks a bit clunky, we can bury this idea.

pws


  reply	other threads:[~2020-01-27 14:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 23:20 Andrew Reyes
2020-01-18 19:40 ` Daniel Shahaf
2020-01-23  3:12   ` Daniel Shahaf
2020-01-23  9:53     ` Peter Stephenson
2020-01-26  0:45       ` Daniel Shahaf
2020-01-27 14:01         ` Peter Stephenson [this message]
2020-01-28 11:09           ` Peter Stephenson
2020-01-29 11:23             ` Peter Stephenson
2020-02-06 12:40               ` Daniel Shahaf
2020-02-06 13:32                 ` Mikael Magnusson
2020-02-06 14:09                   ` Peter Stephenson
2020-03-14  3:28                     ` Daniel Shahaf
2020-01-29  8:34           ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1580133672.4960.15.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).