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

Re: [PATCH] _compdef: Use zsh/param instead of a glob.



On Mon, Aug 27, 2018 at 3:07 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> That said, if there is some way to generate a set of names that is less
> complete but has fewer false positives, we could offer that set under
> one tag and the ${(k)functions[(I)_*]} set under another tag, to allow
> users to get their preferred way by setting the tag-order style.

The ${(k)functions[(I)_*]} set will only differ from the
${^fpath:/.}/_(|*[^~])(:t) set in two ways:
(1) The fpath search will find functions that have not yet been marked autoload.
(2) After autoload functions have been invoked for the first time
${(k)functions[(I)_*]} will have the additional functions from the
base files.

Skipping (1) for only (2) might be considered just as much a loss as
not including (2).  Also, ${(V)_comps} might be a more reasonable
source of the extra functions.

> (Incidentally, I never understood why completion functions didn't use a
> proper namespace, zshfoo_* or some such, like virtually everyone else —
> but that ship has sailed.)

Can't say anybody was really thinking about needing function
namespaces back then.  Miinimize length of identifiers and maximize
similarity to the command for which the completion was being defined
were pretty much the only things in mind.  Remember, this was pretty
close to the era when commands like "ls", "rm", "mv", "ld", etc. were
named.

Aside:  For going horribly overboard the other direction IMO, see:
https://github.com/aecolley/client_bash/blob/master/prometheus.bash



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