From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20818 invoked by alias); 27 Jul 2011 18:24:16 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29625 Received: (qmail 25394 invoked from network); 27 Jul 2011 18:24:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Uev1f5zxGlqI2z1Iec4IVfRL+vjFwXrg0RW/Wu3hgBg=; b=vVmXbMsDOJfreTZlWbZot7rBVYCri7JXgXVSAuErOlYYNmIrQ9ScvsnBPckyN4qK5l Uoc9LxJL7dopHQVjk3xsfEyQ6lX3RiQAdTC/Hl9a3e4G+s7eynUEudFx+gw2sN1xmMqj /kYMvHR5vy2qA4U8kIABBDhCvQCn9t8JaPCUo= MIME-Version: 1.0 In-Reply-To: <110727111829.ZM22827@torch.brasslantern.com> References: <110727012046.ZM21543@torch.brasslantern.com> <110727093848.ZM22383@torch.brasslantern.com> <110727111829.ZM22827@torch.brasslantern.com> Date: Wed, 27 Jul 2011 20:24:08 +0200 Message-ID: Subject: Re: completers using zstat don't work with zmodload -F zsh/stat From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 27 July 2011 20:18, Bart Schaefer wrote: > On Jul 27, 6:44pm, Mikael Magnusson wrote: > } Subject: Re: completers using zstat don't work with zmodload -F zsh/stat > } > } # alias zstat='builtin stat' > } # rm $fpath[3].zwc* > } removed `/usr/local/share/zsh/4.3.12-dev-1/functions.zwc' > } removed `/usr/local/share/zsh/4.3.12-dev-1/functions.zwc.old' > } # for a ($fpath) {[ -w $a:r -a $a/_*(N[1]) ] && zrecompile -p -U -z > } $a.zwc $a/_*} > } re-compiling /usr/local/share/zsh/4.3.12-dev-1/functions.zwc: succeeded > } > } % umount > } _canonical_paths_add_paths:6: no such builtin: stat > > This must be happening because _canonical_paths_add_paths isn't actually > defined until _canonical_paths is executed, so the -U option to zcompile > doesn't have a chance to come into effect. > > This is going to be a problem with any completion source file that has > multiple embedded function definitions. > > It MIGHT help to both use "zcompile -a" and also change _canonical_paths > from using > > _canonical_paths_add_paths () { > ... > } > > to using the load-once paradigm > > (( $+functions[__canonical_paths_add_paths] )) || > _canonical_paths_add_paths () { > ... > } > > but I'm not confident of that. Hm, but if it's only loaded at "runtime", why does the alias get expanded then? My user doesn't have the zstat alias. Are aliases still expanded during compilation inside function definitions but -U is somehow not active? (This sounds odd). -- Mikael Magnusson