From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13944 invoked from network); 11 Nov 2003 15:26:40 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 11 Nov 2003 15:26:40 -0000 Received: (qmail 21893 invoked by alias); 11 Nov 2003 15:26:27 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6760 Received: (qmail 21808 invoked from network); 11 Nov 2003 15:26:26 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 11 Nov 2003 15:26:26 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 11 Nov 2003 15:26:26 -0000 Received: from EXCHANGE02.csr.com (unverified) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Tue, 11 Nov 2003 15:26:10 +0000 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 11 Nov 2003 15:25:37 +0000 To: zsh-users@sunsite.dk Subject: Re: Completion function for bitkeeper? In-reply-to: "Oliver Kiddle"'s message of "Tue, 11 Nov 2003 16:21:32 +0100." <11367.1068564092@gmcs3.local> Date: Tue, 11 Nov 2003 15:24:32 +0000 Message-ID: <8193.1068564272@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 11 Nov 2003 15:25:37.0784 (UTC) FILETIME=[0EFA0F80:01C3A868] Oliver Kiddle wrote: > _foo() { > local expl > _description foo expl foos > _bar "$expl[@]" > } > > As a result of zsh having dynamic scoping, _foo's $expl is still > visible inside _bar. _foo happens to use $expl for storing compadd > options to pass on. Knowing this the author of _bar could take > advantage of it but it'd be bad programming (and might break if _bar > was called from elsewhere). To actively prevent it, we need static > scoping. Hmm... isn't the problem that the $expl set at this point and passed down to _bar ultimately ends up getting passed to compadd (maybe indirectly), while _bar may add its own options? I've seen this sort of thing when trying to sort out the sorting, i.e. the -J and -V options to compadd. Often one of them's already lurking in $expl at the point where I want to propagate my choice of option down through the system. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************