Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Forgetting about compinit with manual alteration of _comps
- X-seq: zsh-users 21264
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: Forgetting about compinit with manual alteration of _comps
- Date: Wed, 10 Feb 2016 09:23:22 +0000
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAKc7PVBLufmR3wLZ8mVGpGq1o1DgB8ci3bH3X6cyzbMyEOoZZg__29303.1625486494$1455013779$gmane$org@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBLufmR3wLZ8mVGpGq1o1DgB8ci3bH3X6cyzbMyEOoZZg__29303.1625486494$1455013779$gmane$org@mail.gmail.com>
Sebastian Gniazdowski wrote on Tue, Feb 09, 2016 at 11:28:10 +0100:
> 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?
As far as I know, $_comps is an implementation detail, meaning it may
change incompatibly without notice. Instead of assigning to $_comps,
you should use 'compdef _mycmd mycmd', which is a stable API.
However, I'm not sure making a plugin loadable _either before or after_
compinit is a good idea. It may be simpler for plugin authors to expect
to be loaded in one circumstance (say, after compinit) and ensure they
emit a clear error message in the other circumstance (say, before
compinit), than to eternally support two codepaths.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author