Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: compinit in emulation
- X-seq: zsh-workers 47860
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: compinit in emulation
- Date: Thu, 21 Jan 2021 13:59:06 -0800
- Archived-at: <https://zsh.org/workers/47860>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-01/CAH%2Bw%3D7ac56oOu%2BQz98FsH-L1Tuc_%3DP3NNREg7kVckd%3D2epS04Q%40mail.gmail.com>
- In-reply-to: <91910-1611265666.544073@yljT.3NHd.u6Oz>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7bEM_qRUk5-eF=FPZPHzyF6o=Z6s3FgOqkF+OoFJWwJiQ@mail.gmail.com> <91910-1611265666.544073@yljT.3NHd.u6Oz>
On Thu, Jan 21, 2021 at 1:47 PM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> Bart Schaefer wrote:
> > The documentation says:
> > If the parameter _compdir is set, compinit uses it as a directory where
> > completion functions can be found; this is only necessary if they are
> > not already in the function search path.
>
> I'm not entirely clear what that feature is trying to achieve. So you
> can wipe out $fpath but set _compdir to the location of the completon
> functions and compinit will kindly fill out $fpath with all the
> completion directories again.
Well, no. _compdir is used in compaudit, and it appends to fpath
rather than replaces it. So that whole paragraph in the doc is wrong
if "compinit -C" is used.
> > However, this depends on the fpath/FPATH tied variable linkage, which
> > is disabled when not in native zsh mode. I wrongly expected 'emulate
> > -R zsh' to fix this, and spent quite a while down a rabbit hole trying
> > to figure out what was wrong.
>
> I get "compinit:141: parse error: condition expected: $1" when trying to
> use the feature from sh emulation - is that what you're referring to?
No; compaudit only appends to the fpath array, so FPATH is never
updated, so all the work compaudit does searching in $_compdir is
useless.
I avoided the parse error by using { emulate zsh -c 'autoload
compinit' } and things still fail because fpath is not tied to FPATH.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author