Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH v2] Re: [PATCH] _add-zle-hook-widget: New completion.



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



Messages sorted by: Reverse Date, Date, Thread, Author