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

Re: How completions work, do they require fpath?



On 27 January 2016 at 08:20, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> No, it doesn't contradict the manual.  The check for a directory named
> "Base" is to distinguish "configure --enable-function-subdirs" from the
> default configuration which is to avoid creating subdirectories.  If
> the "Base" directory is present it's expected to contain all the
> files from Completion/Base/ in the source tree, and although the
> explicit check is not done the directories AIX/, BSD/, Cygwin/, etc.
> are also expected to be found within $_compdir in that case.

So using _compdir would be a hack, and also, someone can utilize
_compdir for what's it's intended, and overwriting _compdir would
broke their setup.

> This is NOT an indication that you can co-opt these directories for
> plugins, nor is it "safe" to run compinit more than once with a new
> value of $_compdir -- I'm fairly sure you will mangle, or misuse, or
> both, the ~/.zcompdump file if you do so.

So it seems that fpath is needed. I saw Peter's email (workers/12379)
suggesting that work has been done to make fpath the choice for
providing new completions. I wanted to have fpath "clean", and I guess
I can still have it like this: create ~/.zplugin/completions, add it
to fpath, simlink any plugin's "_*" files there. But this will broke
if a completion uses autoload of some functions from plugin's
directory. A very rare case however, I guess.

Best regards,
Sebastian Gniazdowski



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