From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9403 invoked from network); 19 Sep 2000 07:29:12 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Sep 2000 07:29:12 -0000 Received: (qmail 24381 invoked by alias); 19 Sep 2000 07:28:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12841 Received: (qmail 24372 invoked from network); 19 Sep 2000 07:28:31 -0000 From: "Bart Schaefer" Message-Id: <1000919071851.ZM30493@candle.brasslantern.com> Date: Tue, 19 Sep 2000 07:18:50 +0000 In-Reply-To: <000001c021fd$80f81b80$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "RE: Is this statement correct?" (Sep 19, 9:50am) References: <000001c021fd$80f81b80$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Andrej Borsenkow" , Subject: Re: Is this statement correct? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 19, 9:50am, Andrej Borsenkow wrote: } Subject: RE: Is this statement correct? } } > > This is not usually } > > a problem, because zsh always looks for the newest file when loading a } > > function, but it may cause slower shell startup and function loading. } } It does not work: } } bor@itsrm2% print $fpath } /home/bor/.zsh.d/completion /home/bor/.zsh.d/std-3.1.9-dev-6.zwc } /home/bor/.zsh.d/functions /tools/share/zsh/site-functions ... (standard } part follows) } bor@itsrm2% ll /tools/share/zsh/3.1.9-dev-6/functions/Core/_match } -rw-r--r-- 1 root other 1539 Sep 19 09:44 } /tools/share/zsh/3.1.9-dev-6/functions/Core/_match } bor@itsrm2% ll ~/.zsh.d/std-3.1.9-dev-6.zwc } -rw------- 1 bor sinix 1491984 Sep 18 11:08 } /home/bor/.zsh.d/std-3.1.9-dev-6.zwc } } Zsh takes _match from digest file and *not* from external definition. } Even if it is newer. The order of $fpath takes precedence over the newness of the files. It doesn't search for the newest thing anywhere in $fpath; it checks for the newest one of any two otherwise-equivalent sources of the function. In particular, zsh does not read the name of the source file out of the digest file and try to find it. The autoload-time checks are all done relative to *directories* named in $fpath. If you put a digest name into $fpath (as you have), then that file is accepted automatically. If on the other hand you leave directory names in the path and put the digest file alongside the directory (within that directory's parent), then zsh will check for the newer of a function in the directory or a function in the digest file. So if you have fpath=(/zsh/fdir) and these three files: /zsh/fdir.zwc /zsh/fdir/func /zsh/fdir/func.zwc Then zsh will always pick the newest one for the definition of "func". I suppose the example in contrib.yo is a bit misleading because it replaces the directory names with digest file names in $fpath. That's actually not necessary for zrecompile to work. -- 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