Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _compdef: Use zsh/param instead of a glob.
- X-seq: zsh-workers 43334
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _compdef: Use zsh/param instead of a glob.
- Date: Sun, 26 Aug 2018 10:54:04 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=sRpi71UA7Tz5etrGI 0pjqNi3zYV04RoclYb46o1RhVk=; b=aaP5zV7VrgLQycz2Cba/IRXYRnSdVaf67 v38MwRbrBGavW7VkqCJBeDfAt0+NMhrgaZbl4ShlHPamOA+NpgwU3K6SXbZfmPYD irfsVLjKG6n/c3aqavYXnBjLSyc/X5C0LuVt7qZPKP+u8pJIEmgmMRPCmlMcWSMi NVLSFPRkZlpRLblR/hhA/DDDpmjNeI/04ZPaAS2oPSQh3sSw6QPRqTv8tKrqUrTr K0IqBhY0GOMg97UjlA33+IB5/GClrsVkCYwY8bhLPFgEAq+I8g1mZY7kNJrwbFnh RoUDbgkR0QXsIL8AYPlbOru3oOmfM+dY3H+Y8n0NoIogYuPZYujFw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=sRpi71UA7Tz5etrGI 0pjqNi3zYV04RoclYb46o1RhVk=; b=lPnOFWJY9Q08mgCqKr9DKdoBbSas/5AsD 4cEjtJdkmg7cznMqNnDWCQR6UrubZ6a3PcfD48nJE54/FrWiZJPGMXWCAaKzmNW/ VF7YWYP9xwxGSWyagiBzFIPHDW4UYxCV/Qu1AT2GT4+qmQkgYAacwF+YV0iXOoGo a1pQr8itByvNu6eh2WNutsBuEc/0kXq3ZZ+B6ro8yTAIkdXlNv1jHVATjbfELYgn SSaQIsq7cKdC1qY48H6aND4ddysnXKwP2EOGzGMykY4110S8UHjeWzXMgl+01uIn 7t0d9IsAZMrHPWABcWm14xZR2wEtPakALTcWtVNWFRZWMS79Yuzlg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
In particular, this allows functions defined inside another file to be
offered, such as various __git_foo() helpers defined in ${^fpath}/_git.
---
Completion/Zsh/Command/_compdef | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Completion/Zsh/Command/_compdef b/Completion/Zsh/Command/_compdef
index 7a64da835..003c37da3 100644
--- a/Completion/Zsh/Command/_compdef
+++ b/Completion/Zsh/Command/_compdef
@@ -1,6 +1,6 @@
#compdef compdef
-local state line expl list disp curcontext="$curcontext" pat normal ret=1
+local state line expl disp curcontext="$curcontext" pat normal ret=1
local args1 args2
typeset -A opt_args
@@ -57,7 +57,8 @@ case $state in
_wanted commands expl 'completed command' compadd -k _comps && ret=0
;;
cfun)
- list=( ${^fpath:/.}/_(|*[^~])(:t) )
+ typeset -aU list=( ${(k)functions[(I)_*]} )
+ (( ${+list[1]} )) || list+=( ${^fpath:/.}/_(|*[^~])(:t) )
if zstyle -T ":completion:${curcontext}:functions" prefix-hidden; then
disp=( ${list[@]#_} )
_wanted functions expl 'completion function' \
Messages sorted by:
Reverse Date,
Date,
Thread,
Author