From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18618 invoked from network); 2 Jun 2005 17:03:05 -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 17:03:05 -0000 Received: (qmail 6653 invoked from network); 2 Jun 2005 17:02:59 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Jun 2005 17:02:59 -0000 Received: (qmail 11799 invoked by alias); 2 Jun 2005 17:02:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21305 Received: (qmail 11789 invoked from network); 2 Jun 2005 17:02:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Jun 2005 17:02:55 -0000 Received: (qmail 6356 invoked from network); 2 Jun 2005 17:02:54 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 2 Jun 2005 17:02:51 -0000 Received: from candle.brasslantern.com ([4.11.1.68]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IHG00LMAVCONOA3@vms044.mailsrvcs.net> for zsh-workers@sunsite.dk; Thu, 02 Jun 2005 12:02:49 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j52H2mYA012817 for ; Thu, 02 Jun 2005 10:02:48 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j52H2loM012816 for zsh-workers@sunsite.dk; Thu, 02 Jun 2005 10:02:47 -0700 Date: Thu, 02 Jun 2005 17:02:47 +0000 From: Bart Schaefer Subject: Re: PATCH: expl not always local In-reply-to: <2817.1117730651@trentino.groupinfra.com> To: zsh-workers@sunsite.dk Message-id: <1050602170247.ZM12815@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050602132519.GA10266@localhost.localdomain> <1050602152831.ZM12324@candle.brasslantern.com> <2817.1117730651@trentino.groupinfra.com> Comments: In reply to Oliver Kiddle "Re: PATCH: expl not always local" (Jun 2, 6:44pm) 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=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Jun 2, 6:44pm, Oliver Kiddle wrote: } Subject: Re: PATCH: expl not always local } } 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, } } I disagree. The only way we should be passing stuff to #autoload (Type/) } functions is with the positional parameters. I agree with your "should" but I don't believe that it's presently the case that all completion functions work that way. Blindly adding a lot of "local" declarations without investigating the calling contexts is a road to mysterious future breakage. In part this is because the inner workings of the completion system are so sketchily documented. The Doc/compsys.yo entry for _wanted, for example, doesn't use "local expl" in its examples, and none of the documentation is clear that the name "expl" is merely a convention for the second argument of things like _request/_wanted/_next_label/etc. (i.e., any other name ought to do just as well, but probably won't).