From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2293 invoked from network); 2 Jun 2005 16:44:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Jun 2005 16:44:31 -0000 Received: (qmail 95981 invoked from network); 2 Jun 2005 16:44:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Jun 2005 16:44:25 -0000 Received: (qmail 9380 invoked by alias); 2 Jun 2005 16:44:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21304 Received: (qmail 9371 invoked from network); 2 Jun 2005 16:44:21 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Jun 2005 16:44:21 -0000 Received: (qmail 95669 invoked from network); 2 Jun 2005 16:44:21 -0000 Received: from cluster-e.mailcontrol.com (HELO rly07e.srv.mailcontrol.com) (217.79.216.190) by a.mx.sunsite.dk with SMTP; 2 Jun 2005 16:44:14 -0000 Received: from iris.logica.co.uk (iris.logica.co.uk [158.234.9.163]) by rly07e.srv.mailcontrol.com (MailControl) with ESMTP id j52GiCtG010953 for ; Thu, 2 Jun 2005 17:44:12 +0100 Received: from trentino.logica.co.uk ([158.234.142.59]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id j52GiBKM019794 for ; Thu, 2 Jun 2005 17:44:12 +0100 Received: from trentino.groupinfra.com (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id 5D0C86BBA3 for ; Thu, 2 Jun 2005 18:44:11 +0200 (CEST) X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1050602152831.ZM12324@candle.brasslantern.com> From: Oliver Kiddle References: <20050602132519.GA10266@localhost.localdomain> <1050602152831.ZM12324@candle.brasslantern.com> To: zsh-workers@sunsite.dk Subject: Re: PATCH: expl not always local Date: Thu, 02 Jun 2005 18:44:11 +0200 Message-ID: <2817.1117730651@trentino.groupinfra.com> X-Scanned-By: MailControl A-04-00-00-235 (www.mailcontrol.com) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Bart wrote: > Careful with these. They may be expecting to be called in a context > where the caller has declared expl as a local. > > In general, if a function file starts with #autload then it's a > utility and should NOT declare completion system variables as locals, > but if it starts with #compdef then it should declare them local. > There are probably some exceptions, of course. I disagree. The only way we should be passing stuff to #autoload (Type/) functions is with the positional parameters. These various type functions should do stuff like the following: local expl _wanted things expl 'thing' compadd -a "$@" - things Note the single `-' after the "$@". That ensures that any passed explanation takes precendence over the one defined here ("thing"). Many of the functions don't do that however. In part because the single dash feature wasn't there originally. If the function is using compset to chop stuff into separate words then it's own descriptions should be taking precendence. The only variable I can think of where care needs to be taken is curcontext, hence the use of: local curcontext="$curcontext" Oliver This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.