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

Re: Q: _alternative's `(( w1:d1 w2:d2 ))' form



Arseny Maslennikov wrote:
> The doc page for _alternative (citing `info zsh`, menu item `Completion
> Functions') states:
...
> Later on, the text for _arguments advises to escape the separating
> colons between the match candidate and its description in a (( ))
> action spec, due to more complex spec parsing and further optional
> fields. A thorough reader of the docs might think the same is
> required by _alternative as well.

You're right. With _alternative, it isn't necessary to escape further
colons. If you do, it's harmless. Searching the sources _file_modes does
quote them, _diff_options and _git don't. I'd have expected to find more
uses of the feature really but I may have not used the best regex to
find them.

> Is this intentional? If yes, should we fix the doc paragraph
> on _alternative?

Yes to both of those. Patches that improve the documentation are
gratefully accepted.

Oliver




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