From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3372 invoked from network); 1 Aug 2000 14:15:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Aug 2000 14:15:54 -0000 Received: (qmail 10713 invoked by alias); 1 Aug 2000 14:15:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12465 Received: (qmail 10706 invoked from network); 1 Aug 2000 14:15:31 -0000 From: "Bart Schaefer" Message-Id: <1000801141517.ZM30551@candle.brasslantern.com> Date: Tue, 1 Aug 2000 14:15:17 +0000 In-Reply-To: <200008010825.KAA06563@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "PATCH: Re: missing -o kshautoload checks" (Aug 1, 10:25am) References: <200008010825.KAA06563@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: Re: missing -o kshautoload checks MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 1, 10:25am, Sven Wischnowsky wrote: } } Bart Schaefer wrote: } } > ... } > } > I haven't actually tried it, but I'm pretty sure that if you `zcompile -z' } > a file that ends with `[[ -o kshautoload ]] && $0 "$@"', and you have } > kshautoload set, you'll end up executing the function *twice* the first } > time it's autoloaded. } } No, it is *not* executed on the first call. Ok, it is executed, but } one won't see that because it only redefines itself (and any helper } functions). I think you're wrong, but it's because I've tricked you with a typo. The usual idiom is `[[ -o kshautoload ]] || $0 "$@"', but I wrote `&&'. With && zsh will execute the function, because kshautoload does *not* become temporarily unset just because the function is loaded with zsh semantics. However, the first execution just harmlessly redefines the function, so you won't notice. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net