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

Re: completion oddity



On Tue, May 22, 2012 at 9:35 AM, Greg Klanderman <gak@xxxxxxxxxxxxxx> wrote:
>
> Is there something I can put in matcher-list to effectively turn off
> this default and globally get the behavior as when you added "-M ''"

No.  The sneaky thing here is that generically, the matcher-list
zstyle is for matching file names, not command options.

Consequently _arguments doesn't use the matcher-list style itself;
it's up to the individual context completion functions (like _k in the
example) to look up the style (presumably in an option-specific style
context) and pass it to _arguments -M.

Practically speaking, the assumption is that the completion function
must "know" exactly what the command options "look like" for the
command it is completing, so there's no reason to provide a way for
the user to override it.  File names, on the other hand, could look
like anything, so the user is given hooks to tell completion about
those file names.

I can't recall any discussion of leading to a conscious decision to
have it work this way; it just fell out so from the incremental
process of making the completion system handle common cases cleverly
(without requiring the user to tweak everything).



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