Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: completion math functions from other modules
- X-seq: zsh-workers 43818
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: completion math functions from other modules
- Date: Mon, 12 Nov 2018 03:00:57 +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=1541988062; bh=fA++PdZx10w04WOj/D/zIs3qktmKsF7a6SHiZcufdWc=; h=From:To:Subject:Date:From:Subject; b=dwnZVpJTKyZhdYwwH+0/huJ8uBKKZQipZ/CDMfZNqcCFL7wLqCeNyDGUqMsU0TuUmLMiNtZMoXrWjFLVL+IWSWrZI3jH3oStzGKiI88OcMPIITaxcoAgVaeBEcmPOo6zkYQ1V/EYkPB1sSxUYh33M4RYpZpSGxHVufupQZrGd+YkGP3X1fU0ouq8hg2r+6uA6RRsVpRkYaxGKL3fBAiaNsqaIXo8M/JXCw03Nnhdww0BTTbd2mc1BQ8SwCQsRCoe4kFDOqCAol14ftwTxrVBeLajZqxtveXf2QUh8K64ICw8UzTFKdHvu6/8GYmLjEkhRSLCmmhA3cCJmnsdOLMUiQ==
- 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
_module_math_func currently only considers zsh/mathfunc. This extends it
to also check zsh/system as that also defines a math function (and, for
what it's worth, zsh/example).
Oliver
diff --git a/Completion/Zsh/Type/_module_math_func b/Completion/Zsh/Type/_module_math_func
index 6be9c006a..5044bdf4c 100644
--- a/Completion/Zsh/Type/_module_math_func
+++ b/Completion/Zsh/Type/_module_math_func
@@ -1,9 +1,12 @@
#autoload
-local expl
-local -a funcs
+local mod
+local -a funcs alts
+local -a modules=( example mathfunc system )
-funcs=(${${${(f)"$(zmodload -Fl zsh/mathfunc 2>/dev/null)"}:#^+f:*}##+f:})
+for mod in $modules; do
+ funcs=( ${${${(f)"$(zmodload -Fl zsh/$mod 2>/dev/null)"}:#^+f:*}##+f:} )
+ alts+=( "module-math-functions.${mod}:math function from zsh/${mod}:compadd -S '(' $funcs" )
+done
-_wanted module-math-functions expl 'math function from zsh/mathfunc' \
- compadd -S '(' -q "$@" -a funcs
+_alternative $alts
Messages sorted by:
Reverse Date,
Date,
Thread,
Author