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

Re: PATCH: allow default match specs to be disabled (was Re: [PATCH v4] zsh localedef completion)

Bart wrote:
> } This patch uses x: as the token. Any thoughts on that or alternative
> } suggestions?
> My only other thought would be a single hyphen or a single exclamation
> point, for similarity with the tag-order style, 

A single hyphen wouldn't be a good idea because _wanted and similar
helpers look for a single hyphen to indicate where they should insert
the explanation options. The way ! is used in tag-order is somewhat
different. Do you have a preference for it as such?

>   * it matters that the global matcher is prepended to matcher-list
>      rather than appended

By global matcher do you mean the "matcher" style; it is only global
if specified with a very general context. What is your source for that
statement? The only line of documentation I've found that implies that
comes from a clarification patch in users/18550. It originally used
the wording "added to".

> What is it that leads you to think it's order-independent?

Well the word "order" is absent from the "Completion Matching Control"
section of the manual. And I can't think of a way for one matching spec
to affect another.

> I have this comment in my .zshrc:
> zstyle ':completion:*' matcher-list '' 'r:|[-._,]=** r:|=**' \
>     'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._,]=** r:|=**' \
>     'r:|[-._,]=** r:|=** l:|=*'

> Maybe I'm misunderstanding your question.

Yes, my question concerned only the order of match specifications as they
are passed to compadd -M within a single string. So is there, for example,
any difference between
  -M 'r:|[-._,]=** r:|=**' and
  -M 'r:|=** r:|[-._,]=**'

The order of matcher-list arguments clearly does matter - _main_complete
(or _prefix) looks them up and tries them one after the other in order.
But within an argument, can the order of the various r: and m: specs
matter? I'm fairly sure the answer is no.


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