From bde4cfde51526bb8910c1dfbce8b6e4c4e1f5149 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 13 Jun 2000 11:55:06 +0000 Subject: new _generic widget to call completion with $WIDGET in function field of context (?) --- Doc/Zsh/compsys.yo | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Doc/Zsh/compsys.yo') diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index f23f993fd..5167c626b 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -2452,6 +2452,20 @@ Unlike tt(_expand) this uses a `tt(1)' (one) as the default value for the tt(substitute) and tt(glob) styles, so both types of expansion will normally be performed. ) +findex(_generic) +item(tt(_generic))( +This function is not defined as a widget and not bound by +default. However, it can be used to define a widget and will then +store the name of the widget in the var(function) field of the context +and call the completion system. This allows to easily define custom +completion widgets with their own sets of style settings. For example, +to define a widget that does normal completion and starts +menu-selection, one could do: + +example(zle -C foo complete-word _generic +bindkey '...' foo +zstyle ':completion:foo:*' menu yes select=1) +) findex(_history_complete_word) (\e/)) item(tt(_history_complete_word) (\e/))( Complete words from the shell's command history. This uses the -- cgit 1.4.1