zsh-workers
 help / color / mirror / code / Atom feed
From: Martin Buchholz <martinrb@google.com>
To: Peter Stephenson <Peter.Stephenson@csr.com>
Cc: zsh-workers@zsh.org, Joel Ebel <jbebel@google.com>
Subject: Re: zsh ignores the arguments on its first command.
Date: Thu, 3 Jun 2010 06:22:57 -0700	[thread overview]
Message-ID: <AANLkTilx2bOk5hHYLVly8XCIu4xz4hhtFHpgTaP4otN3@mail.gmail.com> (raw)
In-Reply-To: <20100603100109.1b090b4e@csr.com>

On Thu, Jun 3, 2010 at 02:01, Peter Stephenson <Peter.Stephenson@csr.com> wrote:
> On Wed, 2 Jun 2010 09:44:13 -0700
> Martin Buchholz <martinrb@google.com> wrote:
>> I was thinking that, in addition,
>> the construct ${+NAME}
>> should never cause "unknown parameter",
>> not even due to failure to load a module
>> that provides the parameter as a feature,
>> so an additional fix in the zsh core might be good.
>> If a module fails to load, NAME should become an
>> ordinary unset variable, and ${+NAME} should be 0.
>
> I don't think that can be right.  You're basically asking for all (or a
> substantial subset of) autoload failures to be silent.

I think you're right that users should be notified
of all module load failures, including those
caused by autoloaded features.

However, "unknown parameter" is a very
misleading and frustrating error message,
especially when the construct ${+NAME}
asks to simply return 0 for unknown parameters.

Emacs has a similar feature, and a more
informative error message, of the form

    error ("Autoloading failed to define function %s",

So please change the zsh error to something like

"Autoloading of module %s failed to define parameter %s"

Martin

> To me, the module autoload is a contract that when you reference the
> variable the module *will* be loaded.  If it isn't that's an error.  Take
> the present example: the module failed to load because of an error that (so
> far as I know) we're not interested in.  If this instead failed silently
> the user would simply know that $terminfo wasn't working despite the fact
> they've (maybe implicitly) asked for it and not have a clue why or even
> that something had failed and hence wouldn't know what to do about it.
>
> The autoload interface is a convenience to avoid you having to load modules
> explicitly, which deliberately doesn't expose the module layer directly, so
> necessarily interacts with it simply (load the module on demand, and that's
> it).  If you're paranoid about not having module loads fail you need to do
> more at the zmodload level.
>
> --
> Peter Stephenson <pws@csr.com>            Software Engineer
> Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
> Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
>
>
> Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
>


  reply	other threads:[~2010-06-03 13:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 21:23 Martin Buchholz
2010-06-01 21:45 ` Peter Stephenson
2010-06-01 22:27   ` Martin Buchholz
2010-06-02  7:05   ` Martin Buchholz
2010-06-02 11:19     ` Peter Stephenson
2010-06-02 16:44       ` Martin Buchholz
2010-06-03  9:01         ` Peter Stephenson
2010-06-03 13:22           ` Martin Buchholz [this message]
2010-06-03 13:32             ` Peter Stephenson
2010-06-03 13:47               ` Martin Buchholz
2010-06-03 14:15               ` Bart Schaefer
2010-06-03 14:20                 ` Peter Stephenson

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=AANLkTilx2bOk5hHYLVly8XCIu4xz4hhtFHpgTaP4otN3@mail.gmail.com \
    --to=martinrb@google.com \
    --cc=Peter.Stephenson@csr.com \
    --cc=jbebel@google.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).