Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: The default $fpath

Peter Stephenson wrote:
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> I can't think of any; presumably the configure-time (?) code for this
>> would resemble
>>     if [ X$ac_default_prefix != X/usr/local ]
>>     then fixed_sitefndir=/usr/local/zsh/site-functions
>>     elif [ X$tzsh_name != Xzsh ]
>>     then fixed_sitefndir=/usr/local/zsh/site-functions
>>     else fixed_sitefndir=''
>>     fi
>> and then zsh.mdd would use something like
>>     echo '#define FIXED_FPATH_DIR "'$(fixed_sitefndir)'"' >> zshpaths.h.tmp;
>> and finally somewhere in Src/init.c the fpath would be prefixed with the
>> value of FIXED_FPATH_DIR if it is non-empty.
> OK, so that's an answer to my other open question: you're suggesting (i)
> if the prefix is /usr/local and this is a standard zsh installation
> we keep things the way they are (ii) otherwise the new component is
> the first thing to be tried in the default fpath.

It should probably also check if --enable-site-fndir points to the
location in ‘/usr/local’, not just ‘prefix’. What would the order of
these entries be?

  1. Fixed site-functions (the new entry)
  2. Prefix-based/--enable-site-fndir site-functions
  3. Entries added by --enable-additional-fpath
  4. All the rest of it, like it is now.

I think that would make sense. That's basically the way it is right now,
plus the fixed directory at the very front (unless it's the same as the
old ‘site-functions’ location).

>> The worst that happens is that /usr/local is a remote file system (which
>> would seem rather unlikely) and zsh gets slowed down every time fpath is
>> searched for a directory there that doesn't exist.
> Does seem a bit perverse...  we could add a --disable-fixed-sitenfndir
> for the paranoid.  In other words, this is a simple boolean; either you
> want the shell to be compatible with this pseudostandard, or you don't.

That does sound like a plan, but I'd say that sysadmins for systems like
that could also do:

  % zsh -fc 'print -l $fpath'

...filter out entries that would cause problems like that and set an
amended $fpath in the global ‘zshenv’ file. I don't know which solution
would be preferable...

Regards, Frank

Messages sorted by: Reverse Date, Date, Thread, Author