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

Re: Moving completion functions

Oliver wrote:
> To further explain my reasoning; we install the functions in
> /usr/local/share, not /usr/local/lib. This means that we should be
> prepared for the functions to be *shared* between different computers,
> each of which may run a different operating system. For this reason,
> the installation should/could include AIX, Linux, etc directories.

This is a very good use for keeping subdirectories, but isn't the typical

> But,
> supposing we add something like a cgywin _path_files or a Linux _lsdev,
> we would want to be sure that we are using the correct one.

I think we should take great pains to avoid functions with different
effects having the same names.  If it becomes necessary to split functions,
they should be _path_files_cygwin and _lsdev_linux with some kind of
aliasing or selection mechanism (possibly via styles) where there's a
possibility of a different function being called.  They can still go in
different directories, of course.

> For some reason if you omit the hash -d and just set the variable, i.e.
> for d in a b c; $d=/cygdrive/$d
> I get error messages like this:
> /home/administrator/.zshrc:48: no such file or directory: r=/cygdrive/r

That doesn't work any more; you need to do
  for d in a b c; eval $d=/cygdrive/$d
  for d in a b c; typeset -g $d=/cygdrive/$d
(where the -g is mostly paranoia).

There was some kind of reason for doing this at the time, beyond making
people complain about gratuitous changes which stop things working (though
I often think the second effect is the more significant).

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070

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