From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: compinit in emulation
Date: Thu, 21 Jan 2021 13:59:06 -0800 [thread overview]
Message-ID: <CAH+w=7ac56oOu+Qz98FsH-L1Tuc_=P3NNREg7kVckd=2epS04Q@mail.gmail.com> (raw)
In-Reply-To: <91910-1611265666.544073@yljT.3NHd.u6Oz>
On Thu, Jan 21, 2021 at 1:47 PM Oliver Kiddle <opk@zsh.org> 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.
prev parent reply other threads:[~2021-01-21 21:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 1:22 Bart Schaefer
2021-01-21 21:47 ` Oliver Kiddle
2021-01-21 21:59 ` Bart Schaefer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7ac56oOu+Qz98FsH-L1Tuc_=P3NNREg7kVckd=2epS04Q@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=opk@zsh.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).