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

Re: Globbing question



Peter wrote:

> OK, so you're saying that in most contexts, you can do something like
> 
>   zstyle ':completion:*' file-patterns '*(#q-*)'
> 
> to complete only executable files, but the specific example

That's right. (The #q isn't needed though.)

>   zstyle ':completion:*:complete:-command-::commands' file-patterns '*(#q-*)'
> 
> doesn't work because it goes through the code the wrong way?  I would

Turns out that executables are added by using `compadd -k commands' so
it isn't filename based completion at all.

> say that *is* an annoyance, and that 99% of users don't care about
> the difference between _files and _path_files.

The only difference between _path_files and _files is that _files looks
up file-patterns. _path_files should only be used if there is a good
reason to disallow file-patterns.

Styles are there for adjusting things according to user preferences not
for fixing bugs in the underlying code. So the "annoyance" is not that
file-patterns or ignored-patterns can't handle this.

> Some cross-referencing between ignored-patterns and file-patterns might
> be beneficial, too.

Yes that's true.

> Presumably a side effect of using file-patterns is the _ignored
> completer doesn't pick up the remaining files, but if I remember there
> are ways of doing this with the all-files tag.

You can call the tag what you like. The value of file-patterns is a list
much like tag-order. It just happens that the default value includes an
all-files tag with the pattern *.

Oliver



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