Subject: Re: [PATCH v2] Re: [PATCH] _add-zle-hook-widget: New completion.
From: Oliver Kiddle <[email-masked]>
To: [email-masked]
Date: Fri, 22 Jul 2016 20:45:40 +0200
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Daniel Shahaf wrote:
> > Furthermore, while checking that this wasn't intentional I noticed
> > a couple of functions that use _normal where _default was meant.
>
> _default appears to be undocumented.

Actually it sort of is documented: the section on special contexts which
mentions -default- and says that default implementations exist named
_context. Should there perhaps be findex entries there for each context?

Thinking about it, perhaps the original intention was that _dispatch
should be used but direct calls to _default are widespread and date
back to early times. How about the following.

Oliver

diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 8792324..460cbb6 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -4217,6 +4217,12 @@ 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(_default)
+item(tt(_default))(
+This function corresponds to the tt(-default-) special context. It is
+also used directly as a fallback when a function is unable to provide
+more specific completions.
+)
 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) ... ])