From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18902 invoked from network); 6 Jun 2005 17:27:36 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Jun 2005 17:27:36 -0000 Received: (qmail 89346 invoked from network); 6 Jun 2005 17:27:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Jun 2005 17:27:22 -0000 Received: (qmail 25881 invoked by alias); 6 Jun 2005 17:27:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21314 Received: (qmail 25790 invoked from network); 6 Jun 2005 17:27:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Jun 2005 17:27:09 -0000 Received: (qmail 86319 invoked from network); 6 Jun 2005 17:27:04 -0000 Received: from cluster-e.mailcontrol.com (HELO rly09e.srv.mailcontrol.com) (217.79.216.190) by a.mx.sunsite.dk with SMTP; 6 Jun 2005 17:26:57 -0000 Received: from iris.logica.co.uk (iris.logica.co.uk [158.234.9.163]) by rly09e.srv.mailcontrol.com (MailControl) with ESMTP id j56HQtDS017736 for ; Mon, 6 Jun 2005 18:26:56 +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 j56HQtKM014797 for ; Mon, 6 Jun 2005 18:26:55 +0100 Received: from trentino.groupinfra.com (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id EBE6032F40 for ; Mon, 6 Jun 2005 19:26:54 +0200 (CEST) X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1050602170247.ZM12815@candle.brasslantern.com> From: Oliver Kiddle References: <20050602132519.GA10266@localhost.localdomain> <1050602152831.ZM12324@candle.brasslantern.com> <2817.1117730651@trentino.groupinfra.com> <1050602170247.ZM12815@candle.brasslantern.com> To: zsh-workers@sunsite.dk Subject: Re: PATCH: expl not always local Date: Mon, 06 Jun 2005 19:26:54 +0200 Message-ID: <22953.1118078814@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=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On 2 Jun, Bart wrote: > > 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). In one form of _arguments' specifications, expl is literally used and is not a convention. I think the same applies for _regex_arguments. However, quoting from the _description documentation: The resulting options for compadd are put into the array named /name/ (this is traditionally `expl', but this convention is not enforced). Documentation for the various other functions such as _wanted are mostly fairly clear that _description is called for the descriptions. As you point out, the documentation does omit to declare expl local in the _wanted example. It might have been better if _wanted declared expl local itself and didn't require it as a parameter. However the patch below fixes the documentation. Relying on other Type/ functions to return stuff in expl seems like a weird thing to do. Can you really find any example? Reviewing the calling contexts would be useful but as one step to cleaning up the functions, I'd happily see Doug's change included. Oliver Index: Doc/Zsh/compsys.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v retrieving revision 1.181 diff -u -r1.181 compsys.yo --- Doc/Zsh/compsys.yo 28 May 2005 04:26:58 -0000 1.181 +++ Doc/Zsh/compsys.yo 6 Jun 2005 17:20:51 -0000 @@ -4370,7 +4370,8 @@ Hence to offer only one tag and immediately add the corresponding matches with the given description: -example(_wanted tag expl 'description' \ +example(local expl +_wanted tag expl 'description' \ compadd matches...) Note that, as for tt(_requested), the var(command) must be able to 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.