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

RE: PATCH: Re: Completion and global aliases



>
> And to avoid having them take up memory we could put (the equivalent
> of) `unfunction compinit; autoload compinit' at their ends.
>
> (At least the memory thing was the only reason why I was against
> turning them into functions and I hadn't thought of this before... I'm
> a bit slow sometimes.)
>

Well, the function was initial idea ... and I admit, it was probably wrong
as well. The problem with functions is, they need to be defined somehow ...
that returns us to the same problem, how do I find where this function
lives.

My goal was actually to make new completion (or should I better use function
based completion?) to be as easy to setup as compctl. FBC has great
advantage over compctl - as it stands now, ZSH already comes with handfull
of useful completions that are already even installed :-). The only problem
is to tell it to use them.

As it seems, the possibilities are:

 - predefine compinit as autoloaded function if --enable-fndir is specified
 - create a builtin that will source compinit
 - provide COMPINIT (or eqv) parameter (read-only) to hold the full pathname
of compinit. That is probably the least evil.

In any case, if compinit remains sourced script, I would suggest moving it
away from $fpath (e.g. in ${datadir}/zsh). How many users have 'autoload
$^fpath/*(:t)' as suggested by readme? It is probably not nice having
something else as functions in $fpath.

And related - placement of dump file. Again, now, when most completion
functions are installed in system-wide location - what is the reason to try
put dump file in the same dir as compinit? Why not simply dump it in $HOME
by default? I mean, that check will probably fail in 99% of all
installations.

/andrej




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