zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: completion math functions from other modules
@ 2018-11-12  2:00 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2018-11-12  2:00 UTC (permalink / raw)
  To: Zsh workers

_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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-12  2:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12  2:00 PATCH: completion math functions from other modules Oliver Kiddle

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).