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

RE: completion and globbing, part 2



>
>
> It occurred to me that if the analysis in my last message was true,
> the following would work:
>
> zstyle ':completion:*' completer _oldlist _complete _qcomp _ignored
> bindkey "^I" complete-word
>
> where _qcomp is defined as follows:
>
>    #autoload
>
>    compstate[pattern_match]='*'
>    compstate[insert]=all
>    ret=1
>    _complete && ret=0
>    return ret
>
> This does, in fact, give me exactly the behavior I'm looking for
> without using _expand or _match.
>
> (I also added _ignored, but that doesn't have anything to do with
> this.)
>


In this case, you, probably, do not need _oldlist either.

Well, what you've effectively done is to write stripped-down version of _match
:-) Could you consider patching _match adding a style to control it? But,
really, it may not be as simple. _expand gives you choice to select all
expantions as a tag. But _match just modifies behaviour of subsequent
completer ... I mean, general implementation should give a choice to insert or
not to insert all matching completions. I currently do not see place to put it
in.

May be, widget to do it (insert all current choices) would be the simplest
case. Hmm ... may be it is even possible to implement it as function.

-andrej



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