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

Forgetting about compinit with manual alteration of _comps



Hello,
one calls compinit in .zshrc and then loads something that adds to
$fpath having intention of providing a completion. User is puzzled as
completion doesn't work, has to take care of having compinit placed at
say bottom of .zshrc.

Turns out the loading could be followed by:

    autoload -Uz _mycmd
    _comps[mycmd]=_mycmd

and that sets things working, mycmd is correctly completed. This works
for trivial #compdefs, don't know what side effects can non-trivial
#compdefs have.

The bottom line is: a software package providing trivial completions
can do autoload/_comps alteration to make users happy. If they called
compinit before – completions will work. If they call compinit after –
completions will work also. Any nastiness in this?

Best regards,
Sebastian Gniazdowski



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