zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH 1/3] Make a helper function global.
@ 2016-10-16 17:14 Daniel Shahaf
  2016-10-16 17:14 ` [PATCH 2/3] _zstyle: When completing a style for an unrecognised context, complete all known styles Daniel Shahaf
  2016-10-16 17:14 ` [PATCH 3/3] _zstyle: Complete the -g, -s,-b,-a, -t,-T, -m options Daniel Shahaf
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Shahaf @ 2016-10-16 17:14 UTC (permalink / raw)
  To: zsh-workers

---
 Completion/Zsh/Command/_zstyle  | 16 ----------------
 Completion/Zsh/Type/_completers | 14 ++++++++++++++
 Doc/Zsh/compsys.yo              | 10 ++++++++++
 3 files changed, 24 insertions(+), 16 deletions(-)
 create mode 100644 Completion/Zsh/Type/_completers

diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle
index 20ff47f..dcebc6f 100644
--- a/Completion/Zsh/Command/_zstyle
+++ b/Completion/Zsh/Command/_zstyle
@@ -4,22 +4,6 @@ local state context ostate line expl ctop suf
 local nm=$compstate[nmatches] taglist patterns pstyles contexts
 typeset -A opt_args styles
 
-(( $+functions[_completers] )) ||
-_completers() {
-  # option: -p - needs a `_' prefix
-  local us
-  local -a disp list expl
-
-  list=( complete approximate correct match expand list menu oldlist
-         ignored prefix history )
-  zparseopts -D -K -E 'p=us'
-  [[ -n "$us" ]] && us='_'
-  zstyle -t ":completion:${curcontext}:completers" prefix-hidden &&
-      disp=(-d list)
-  _wanted completers expl 'completer' \
-      compadd "$@" "$disp[@]" - "$us${^list[@]}"
-}
-
 _vcs_info_hooks() {
   compadd - ${functions[(I)+vi-*]#+vi-}
 }
diff --git a/Completion/Zsh/Type/_completers b/Completion/Zsh/Type/_completers
new file mode 100644
index 0000000..87c986a
--- /dev/null
+++ b/Completion/Zsh/Type/_completers
@@ -0,0 +1,14 @@
+#autoload
+
+# option: -p - needs a `_' prefix
+local us
+local -a disp list expl
+
+list=( complete approximate correct match expand list menu oldlist
+       ignored prefix history )
+zparseopts -D -K -E 'p=us'
+[[ -n "$us" ]] && us='_'
+zstyle -t ":completion:${curcontext}:completers" prefix-hidden &&
+    disp=(-d list)
+_wanted completers expl 'completer' \
+    compadd "$@" "$disp[@]" - "$us${^list[@]}"
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 260ace4..a56ca67 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -4246,6 +4246,16 @@ This function completes words that are valid at command position: names of
 aliases, builtins, hashed commands, functions, and so on.  With the tt(-e)
 flag, only hashed commands are completed.  The tt(-) flag is ignored.
 )
+findex(_completers)
+item(tt(_completers) [ tt(-p) ])(
+This function completes names of completers.
+
+startitem()
+item(tt(-p))(
+Include the leading underscore (`tt(_)') in the matches.
+)
+enditem()
+)
 findex(_describe)
 redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ ))ifnztexi(          )))
 xitem(tt(_describe )[tt(-12JVx)] [ tt(-oO) | tt(-t) var(tag) ] var(descr) var(name1) [ var(name2) ] [ var(opt) ... ])


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-16 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-16 17:14 [PATCH 1/3] Make a helper function global Daniel Shahaf
2016-10-16 17:14 ` [PATCH 2/3] _zstyle: When completing a style for an unrecognised context, complete all known styles Daniel Shahaf
2016-10-16 17:14 ` [PATCH 3/3] _zstyle: Complete the -g, -s,-b,-a, -t,-T, -m options Daniel Shahaf

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