Zsh Mailing List Archive
Messages sorted by:
Re: Is this statement correct?
- X-seq: zsh-workers 12841
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>, <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Re: Is this statement correct?
- Date: Tue, 19 Sep 2000 07:18:50 +0000
- In-reply-to: <000001c021fd$80f81b80$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <000001c021fd$80f81b80$21c9ca95@xxxxxxxxxxxxxx>
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
} bor@itsrm2% ll ~/.zsh.d/std-3.1.9-dev-6.zwc
} -rw------- 1 bor sinix 1491984 Sep 18 11:08
} 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
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by: