Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: correctly breaking out of tag loops
- X-seq: zsh-workers 41971
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: correctly breaking out of tag loops
- Date: Wed, 01 Nov 2017 22:01:13 +0100
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1509570680; bh=4Zm9Xpn1SJyOAVb5YdIG87sf667dDTyqkbHP+9royTs=; h=From:To:Subject:Date:From:Subject; b=BSGqVDLzEl08oCvLtKoHcn0w2rO+75sOMyMtFOsmSvteBNhUlCdbFg68m6OPunUKoWRa4nB3J+AnXw0DSlaXKjT7tCYGl6PuR2ZaiCQ+U+NTgAokR7OQ3IGmF8Drqz8dW1gDTu5niTXPBNqbQEDXZCrOp6nW6sRPmCA4RrdcFXh3wn4J1ImB4zaRBnoKQH35sWizSsrciqwFs7bN2YNUDFMj0/U6XMlJdru9sJRPv1CCCvzKNe3RlzPo9dgSa8N0nVLsHtk8yNGfQSyqSBdTsu9cqohooFE25TUSxlwLLfVGRO3rLk+fBG5TuGEIL7dEfqLwRlhdjL9yarbIMwlP6g==
- 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
The tag-order style is not working for make completion to separate
targets from variables (with call-command set). It turns out that it is
not following the correct form for tag loops. The patch switches it to
using _alternative. _make also uses compadd -Q for targets which I can't
quite believe is correct but I'm not going to touch that.
I also searched for other instances of this and found a couple: in
_modutils and _zmodload.
Oliver
diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils
index 5aa4c9cc7..9a37fcae1 100644
--- a/Completion/Linux/Command/_modutils
+++ b/Completion/Linux/Command/_modutils
@@ -119,6 +119,7 @@ _modutils() {
while _tags; do
_requested files expl "module file" _files -g '*.ko(-.)' && ret=0
_requested modules expl module compadd -a modules && ret=0
+ (( ret )) || break
done
;;
diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make
index a2ee9ecac..890ad1c83 100644
--- a/Completion/Unix/Command/_make
+++ b/Completion/Unix/Command/_make
@@ -287,14 +287,9 @@ _make() {
compset -P 1 '*='
_value "$@" && ret=0
else
- _tags targets variables
- while _tags
- do
- _requested targets expl 'make targets' \
- compadd -Q -- $TARGETS && ret=0
- _requested variables expl 'make variables' \
- compadd -S '=' -F keys -- ${(k)VARIABLES} && ret=0
- done
+ _alternative \
+ 'targets:make target:compadd -Q -a TARGETS' \
+ 'variables:make variable:compadd -S = -F keys -k VARIABLES' && ret=0
fi
esac
diff --git a/Completion/Zsh/Command/_zmodload b/Completion/Zsh/Command/_zmodload
index 31163eb72..3416d50c6 100644
--- a/Completion/Zsh/Command/_zmodload
+++ b/Completion/Zsh/Command/_zmodload
@@ -72,6 +72,7 @@ else
_files -W module_path -g '*.(dll|s[ol]|bundle)(:r)' && ret=0
_requested aliases expl 'module alias' \
compadd "$suf[@]" -k 'modules[(R)alias*]' && ret=0
+ (( ret )) || return 0
done
return ret
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author