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

Re: Function installation



"Andrej Borsenkow" wrote:
> > * --enable-fndir=directory allows you to specify a function installation
> >   directory; default is ${datadir}/zsh-fns, almost certainly
> >   ${prefix}/share/zsh-fns
> 
> Peter, are you so fond of cryptic names? Why not simply {datadir}/zsh or, at
> least, ${datadir}/zsh/functions ? (In hope, that may be some more stuff will
> evtl go into base dir).

Well, yes, actually... but zsh/functions is fine.

> Peter, what about something like this:
> 
> use variables like FUNCTIONS_INCLUDE and/or FUNCTIONS_EXCLUDE. They could be
> initialized by configure; and then I could set FUNCTIONS_EXCLUDE='Commands/*
> User/*' FUNCTIONS_INCLUDE='Users/_configure' to get only this one installed?

FUNCTIONS_INSTALL (as I've called it) was easy to add.  I've made it get
set by default to all the Completion subdirectories, and Zftp/* gets added
if dynamic is turned on, but you can override it in configure or make.

Is FUNCTIONS_EXCLUDE important?  Things get excluded anyway unless they're
in FUNCTIONS_INSTALL, so "make install FUNCTIONS_INSTALL='Core/* Base/*
Builtins/* Users/_configure'" will do what you want.  Excluding probably
means looping over the exclusion variable inside the $FUNCTIONS_INSTALL
loop, which I'd like to avoid.

> Now, that we (almost) have the stuff there in fpath automagically, please,
> consider once again making compinit a function. It would provide for
> system-independent rc files - instead of figuring out, where the hell these
> functions are placed here, you simply write compinit - and you're done.

The stuff only gets put into fpath when you run compinit because it knows
the path to compinit, which it wouldn't if it were a function; you'd have
to give it the -f option.  So the nettle of deciding where the things are
has to be grasped anyway.  But this is all supposed to be handled
seamlessly by running compinstall.  At least with the function installation
stuff, you get a sensible default $fpath, which compinstall will check.

One thing's been niggling at me:  if there's a central function repository,
and the user has their own functions, then compinit.dump has to be somewhere
else, probably not in the same directory as compinit.  It looks like
compinit will need to be a bit smarter about working this out.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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