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

RE: noglob and _match

Andrej Borsenkow wrote:

> > Andrej Borsenkow wrote:
> >
> > > bor@itsrm2% noglob ls *TAB
> > >
> > > bor@itsrm2% noglob ls Brodsky/
> > > Completing file
> > > Brodsky/      addrbook.d/   dikz/         observe/      test/
> > > .....
> > >
> > > Is it correct in this case? I suspect, the same aplies to _expand as
> > > well.
> >
> > Why not? I mean: you explicitly requested completion, so the
> > completion system *must* think that you know what you're doing.
> >
> In this case I want to list all files that start with `*' :-)))

Ah, right, sorry, stupid me.

Ok, first, with a completer with _match after _complete (where it
belongs) and files starting with a `*', `ls *<TAB>' *does* give me
only the files matching `\**' as possible completions. If I have
_expand in the completer (before _complete, of course), that takes
precedence and I get the possible expansions in a menu completion.

But even for _expand it can be fixed, of course:

  zstyle -e :completion::::: completer \
    'if [[ $words[1] = noglob ]]; then
       reply=(_expand _complete _match)

And because of this possibility and because being able to selectively
expand glob patterns for noglob I wouldn't like to have that
changed. Especially because it would then probably be harder or even
impossible to get the current behaviour by setting some styles.
Except, of course, we add yet another style that says if it should
behave as it does now or in the way you want it.


Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx

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