Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh ignores the arguments on its first command.
- X-seq: zsh-workers 27993
- From: Martin Buchholz <martinrb@xxxxxxxxxx>
- To: Peter Stephenson <Peter.Stephenson@xxxxxxx>
- Subject: Re: zsh ignores the arguments on its first command.
- Date: Thu, 3 Jun 2010 06:22:57 -0700
- Cc: zsh-workers@xxxxxxx, Joel Ebel <jbebel@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1275571385; bh=02RGP44P/yiRigYMMT6rV1TN/Ho=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=DxCiM5imeUI6tIZZfW9hzSk/CF1KmzSW6EtguRZBceW9opGqStpQuPgQ1Z9w/0/90 dS5gsA3wR2oP6jNjW4Ddw==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=p+UsnRwcaQJCa/mtgcBvIHCLjmVWzUuLGJEgc2u0ZMn94W0ZiT2ComcFe5Q1QvxZW /TQWMNMuwDswpibp+Hd8Q==
- In-reply-to: <20100603100109.1b090b4e@xxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <martinrb@xxxxxxxxxx> <AANLkTikiCBKGaJcuE9s-vMZvK465tTR6WSFIsy6wo7xL@xxxxxxxxxxxxxx> <201006012145.o51LjhGg005724@xxxxxxxxxxxxxxxxxxx> <AANLkTikvkgA0bFLLh7VLVtBbUVMdM64-2iQXjAVbHvaA@xxxxxxxxxxxxxx> <20100602121901.6ce71329@xxxxxxx> <AANLkTimPDymUsBJICkPlnyeFuFLA5Ek80j_aNQH5rXGo@xxxxxxxxxxxxxx> <20100603100109.1b090b4e@xxxxxxx>
On Thu, Jun 3, 2010 at 02:01, Peter Stephenson <Peter.Stephenson@xxxxxxx> wrote:
> On Wed, 2 Jun 2010 09:44:13 -0700
> Martin Buchholz <martinrb@xxxxxxxxxx> 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@xxxxxxx> 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
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author