Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
default tag-order (was Re: zsh 4.2.1-test-A)
- X-seq: zsh-workers 20240
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh <zsh-workers@xxxxxxxxxx>
- Subject: default tag-order (was Re: zsh 4.2.1-test-A)
- Date: Sun, 08 Aug 2004 16:40:20 +0200
- Cc: 258431@xxxxxxxxxxxxxxx
- In-reply-to: <20040808044557.GA8117@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200408061350.i76DovBi028948@xxxxxxxxxxxxxx> <20040806180339.GA31854@xxxxxxxxxxx> <10094.1091886003@xxxxxxxxxxxxxxxxxxxxx> <20040808044557.GA8117@xxxxxxxxxxx>
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