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

Re: completion oddity



On Mon, May 21, 2012 at 11:35:07PM -0700, Bart Schaefer wrote:

> On May 21, 10:01pm, Danek Duvall wrote:
> }
> } I did a quick test with the matcher-list zstyle, though, but couldn't
> } get it to work (without the -M "" in _k).
> 
> Two things ...
> 
> }     zstyle ":completion::complete:k::" matcher-list ""
> 
> (1) The matcher-list is looked up very early in completion.  The context
> isn't yet this specific at that point.  (I think this is in the FAQ.)
> 
> }     zstyle ":completion:*" matcher-list ""
> 
> The matcher-list style is only used when it is not empty!
> 
> _description: [[ -n "$_matcher" ]] && opts=($opts -M "$_matcher")
> 
> So you can't use matcher-list to turn off matching, only to modify it.

So if I set up my own style processing in order to override this behavior
(both the earliness and the use of the empty value) as you suggested to
Greg, would it be kosher to use the matcher-list style, or would I want to
use my own style name?

> }     gtar --show--names<TAB>
> } 
> } and it beeps and moves me to between the second double-hyphen, then after
> } another beep, starts cycling between the two.  If I just have "--show"
> } there, then it ends up cycling among four alternatives.
> 
> Do all four alternatives have the same number of hyphens?

No; three have two, one has one:

    --show-defaults
    --show-omitted-dirs
    --show-transformed-names
    --show-stored-names

I'm still trying to formulate a question about why the default behavior
here is user friendly, but I'm having trouble.  I can understand the logic
of each step, but it doesn't seem like it's the right thing overall.

Thanks,
Danek



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