From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: zsh-users@zsh.org
Subject: Re: question about "-E" option of compadd
Date: Tue, 26 Apr 2016 08:51:07 +0800 [thread overview]
Message-ID: <20160426005107.GM17476@localhost.localdomain> (raw)
In-Reply-To: <160425122004.ZM7508@torch.brasslantern.com>
On Mon, Apr 25, 2016 at 12:20:04PM -0700, Bart Schaefer wrote:
> 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.
>
Thanks so much, now I got it!
> 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.
prev parent reply other threads:[~2016-04-26 1:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 3:07 Han Pingtian
2016-04-25 4:36 ` Bart Schaefer
2016-04-25 7:48 ` Han Pingtian
2016-04-25 19:20 ` Bart Schaefer
2016-04-26 0:51 ` Han Pingtian [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160426005107.GM17476@localhost.localdomain \
--to=hanpt@linux.vnet.ibm.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).