Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: question about "-E" option of compadd
- X-seq: zsh-users 21491
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: question about "-E" option of compadd
- Date: Mon, 25 Apr 2016 12:20:04 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=Ur5SClS4LjQOjTpNmGP4OjeeSccKgMcPyhc2zhxWVkE=; b=cGCsRJtKtezJrx3+xC9ghEIlL/XQGQRzMNwOTPw4LSnBzUxFCjc2nh+CKo6jTbSdFI zjpPFODoZgl5fTw9kH5FGbAGX5vlg4ENVwd4KUWTYPGQzAF5ZKGa6P5KZKPz9d/OwpBH F7AoXZNqjnniHuwBifbGv6PYPHl57Dvru7TbLGs1+9WcEKRwGn82QZWnxpr0QoBgxiKr WWI4rZHLe5X+sEXiqOE3hLvYHvA59Hwcy0a+IFzSiZKCUx/WGSh7jMZI3Tf2R5CS0JVE gnGvGeFQWHWfY/f5lE879yo5YxQJgUD4T0UjfnQcj+pNmPmAkeV6vwh5v3KHyEAeV6lh 3h/A==
- In-reply-to: <20160425074839.GL17476@localhost.localdomain>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20160425030705.GJ17476@localhost.localdomain> <CAH+w=7bF82MSZmqQoBLgRC-2HSZ=S1tAJ66=2c0XdEDaBak48w@mail.gmail.com> <20160425074839.GL17476@localhost.localdomain>
On Apr 25, 3:48pm, Han Pingtian wrote:
} Subject: Re: question about "-E" option of compadd
}
} But looks like even if -E was used, all but one empty strings
} still being removed ? like this:
}
} % _foo()
} compadd -E 3 foo1 foo1 foo1 foo2 foo3 '' '' ''
} % compdef _foo foo
} % foo <tab>
} foo1 foo2 foo3
There's this other part of the documentation for -E
empty matches [are] only useful to format completion lists and to
make explanatory string be shown in completion lists
Without -V -2, the completion listing is deduplicated on the match
string regardless of the descriptions, so you'll only see one of the
possibly several descriptions. With -V -2, identical matches and
their corresponding descriptions are shown, but if the descriptions
are missing then the deduplication still happens.
In other words -E is only used to "pad" the list of matches to have
the same number of elements as the array of descriptions passed to -d.
It's not an error to pass -E without -d but it's not useful either.
Or at least that's my understanding of how it's expected to work, and
is how it works in e.g. Oliver's new _dates helper function; but it
is quite possible that some other combination of options bends it.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author