From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: question about "-E" option of compadd
Date: Mon, 25 Apr 2016 12:20:04 -0700 [thread overview]
Message-ID: <160425122004.ZM7508@torch.brasslantern.com> (raw)
In-Reply-To: <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.
next prev parent reply other threads:[~2016-04-25 19:19 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 [this message]
2016-04-26 0:51 ` Han Pingtian
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=160425122004.ZM7508@torch.brasslantern.com \
--to=schaefer@brasslantern.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).