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

Re: PATCH: widget completion



Oliver Kiddle wrote on Thu, Jul 28, 2016 at 00:27:34 +0200:
> We've got quite a few functions that need to complete zle widgets so it
> seems to warrant factoring out into an _widgets function. This at least
> encapsulates the matching control.

Docs for this:

diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index a50df99..41864f8 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -5046,6 +5046,16 @@ Like tt(_tags) this function supports the tt(-C) option to give a
 different name for the argument context field.  The tt(-x) option has
 the same meaning as for tt(_description).
 )
+findex(_widgets)
+item(tt(_widgets) [ tt(-g) var(pattern) ])(
+This function completes names of zle widgets (see
+ifzman(the section `Widgets' in zmanref(zshzle))\
+ifnzman(noderef(Zle Widgets))\
+).  The var(pattern), if present, is matched against values of the tt($widgets)
+special parameter, documented in 
+ifzman(the section `The zsh/zleparameter Module' in zmanref(zshmodules))\
+ifnzman(noderef(The zsh/zleparameter Module)).
+)
 enditem()
 
 texinode(Completion Directories)()(Completion Functions)(Completion System)

I put in an xref for "Zle Widgets" because zshcompsys(1) defines the
term `widget' near the top to a slightly different meaning.  (By the
way, the bulleted list after "More generally," renders oddly in the man
page version here: no empty line before the first bullet and two empty
lines between the bullets.)

Cheers,

Daniel



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