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

default tag-order (was Re: zsh 4.2.1-test-A)



Clint Adams wrote:
> I just double-checked to make sure I had really tested this with
> 4.2.1-test-A, and I still can't complete any files at all; only options
> are offered.
> 
> This happens with zsh -f followed by compinit.

One of my styles made a difference. I can reproduce it with zsh -f.

The problem is with the default tag-order defined in _tags. The relevant
bit of code is as follows:
     zstyle -a ":completion:${curcontext}:" tag-order order ||
         order=('(|*-)argument-* (|*-)option[-+]* values' options)

There are a few different things we could do here. I can't work out why
"values" needs to be in there. Does _arguments ever add stuff with a
values tag or does _values ever add stuff with an options tag? Can we
remove the values tag from there without breaking anything? It has been
there since the very first version of _tags.

One safe option is to insert `(( ! ${@[(I)options]} )) ||'.
That checks if there is an options tag before applying the tag-order.

Any other thoughts?

Default tag-orders really need thinking about in general. It'd be nice
to be able to specify them from completion functions themself. This code
above should really be in _arguments. That would need care, though. It
is often the case that tag-orders are better not applied for _approximate
or _correct for example.

Oliver



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