Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug: _files depends on extendedglob
- X-seq: zsh-workers 52854
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Ben Knoble <ben.knoble@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: bug: _files depends on extendedglob
- Date: Fri, 29 Mar 2024 20:43:09 +0100
- Archived-at: <https://zsh.org/workers/52854>
- In-reply-to: <5B64A18E-CDA7-4C5F-8CA6-955832F23E77@gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHYJk3Spy=QUF_Kpy19TAniu8n7TdW2owVh9=zamko359MUtVw@mail.gmail.com> <5B64A18E-CDA7-4C5F-8CA6-955832F23E77@gmail.com>
Ben Knoble wrote:
>
> In the linked commit from the original mail I explain the emulation
> mode: it is because the contributed Git completion script sets the
> emulation mode to ksh in order to leave most of the work to the bash
> completion scripts. I therefore (assume I) have to revert to zsh mode
> for _files to behave sensibly: not doing so produced a strange IIRC.
git doc is not an official git command so I'm not sure whether what
you're doing falls within the scope of what that contributed completion
supports but if it does then forcing ksh emulation on your function is
arguably a bug in that git completion.
I'd be very interested if you could elucidate on why you choose to use
that completion instead of the git completion that comes with zsh. It
is perhaps faster due to reduced functionality but in wrapping the bash
completion it has a much more limited interface that prevents it taking
advantage of many of zsh's more powerful features. Zsh's completion does
support handling additional commands in the same manner with, e.g. a
_git-doc function. There can be benefits to upstream projects carrying
completion functions but I usually avoid anything that wraps a bash
function.
> > reason insist on doing this, then you can setopt $_comp_options to
>
> That’s probably a much better workaround than what I had, thanks.
> I’ve confirmed that it works. Is this documented anywhere that I can
> rely on?
That's relying on internal implementation details of the completion
system so you can't really rely on it.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author