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)



On Jun 18, 11:17pm, Oliver Kiddle wrote:
}
} Turns out it isn't hard to do.
} 
} 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, 
 
} There's nothing in the documentation to suggest that the ordering of
} matching specifications has any effect. Is anyone aware of whether it
} perhaps does?

I would expect that it does, for a number of reasons:
  * you can group specs to be tried "all the same time" together in
    a single quoted string, or have several strings that are to be
    tried separately
  * specs can begin with a "+" to append them to an existing spec
  * it matters that the global matcher is prepended to matcher-list
    rather than appended

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

} The documentation of the matcher style was perhaps deceptive in
} indicating that it is tried before matcher-list. The value is merely
} placed before those from matcher-list.

I have this comment in my .zshrc:

# Matching
# 1. Try completion with no alterations (i.e., literal match is best)
# 2. Match substrings separated by dashes, dots, underscores, commas
# 3. As (2) but case-insensitively
# 4. As (2) but allow arbitrary stuff at the beginning of the result
zstyle ':completion:*' matcher-list '' 'r:|[-._,]=** r:|=**' \
    'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._,]=** r:|=**' \
    'r:|[-._,]=** r:|=** l:|=*'

The behavior I see from completion leads me to believe that later
matchers are not tried if earlier matchers generate a result, e.g.,
"literal match is best" => put empty matcher first.

Maybe I'm misunderstanding your question.



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