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

RE: PATCH: yet another completer



> +
> +example(zstyle ':completion:::::' completer _matcher _complete
> _matcher _complete
> +zstyle ':completion:*:matcher-1:::' matcher 'm:{a-z-}={A-Z_}'
> +zstyle ':completion:*:matcher-2:::' matcher 'm:{a-z-}={A-Z_}'
> 'r:|[-_./]=* r:|=*')
> +

Question(s) and comment(s).

- Is it posssible to set match specs on per-command/per-argument basis? In
this case, it is better to include such example. Current one implies, that
you can only set globally valid match specs.

- The most common case so far is file name completion. Can I set default
match specs for _path_files only? That is, default match specs that affect
only file names but not anything else - non-file arguments, options etc


- This is nice as long as you have just a single completer ... but I have
e.g.

zstyle ':completion:*' completer _oldlist _complete _match

If I want to use two different matchers, should I now write

zstyle ':completion:*' completer _matcher _oldlist _complete _match _matcher
_oldlist _complete _match

Looks at least weird.

- This has the same pitfall as global match specs before - it is
position-dependent. Imagine, that I have to matchers and want to add one
more in between. Now, I have to change matcher-2 into matcher-3 in all
styles!

I'd prefer something like "match specs list" - list of match specs that
would be tried until any matches are found. Probably, on per-completer
basis. Or is it intended to be used (useful) only with _complete? Even then
the

zstyle ':completion:*:complete:::' match_specs_list 'm:{a-z-}={A-Z_}'
'r:|[-_./]=* r:|=*'

is much cleaner than

zstyle ':completion:*' completer _matcher _complete _matcher _complete
_match
zstyle ':completion:*:matcher-1:::' matcher 'm:{a-z-}={A-Z_}'
zstyle ':completion:*:matcher-2:::' matcher 'm:{a-z-}={A-Z_}' 'r:|[-_./]=*
r:|=*')

/andrej



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