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

Re: match again



Bart Schaefer wrote:

> On Jan 28,  5:47pm, Alexandre Duret-Lutz wrote:
> } Subject: Re: match again
> }
> } -compstyle '*:options' prefix-hidden yes"
> } +zstyle '*:options' prefix-hidden yes"
> 
> (And several similar examples in comments.)
> 
> These are not equivalent.  Is it really correct to change it this way?
> The actual equivalent of the "compstyle" statement would be 
> 
> 	zstyle ':completion*:options' prefix-hidden yes

Right.

> While I'm on the topic, should there be a ':' before the '*' in that
> example?  One of the defaults installed by compinit itself comes out
> like 
> 	zstyle ':completion*:default' list-colors ...
> 
> whereas all the others resemble one of
> 
> 	zstyle :completion:correct: prompt 'correct to:'
> or
> 	zstyle ':completion:*' verbose yes
> 
> which makes me wonder if it should be
> 
> 	zstyle ':completion:*:default' list-colors ...
> 
> Clue me on the subtlety, please.

The problem is that the default tag is tested in _main_complete which
doesn't add a context name, so it is tested in the simple case as
`:completion:default', but when called from, e.g. _correct_word, as
`:completion:correct-word:default'. A nicer pattern would be
`:completion(|:*):default'.

This is the one place I don't like about the context names. One
solution would be to always stuff `:completion:' in front so that
there are two colons before the completer name, but then we would have 
those double colons not only before the command name (although this
may be not that big a problem).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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