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

Re: PATCH: _info completion

Borsenkow Andrej wrote:

> ...
> This is based on info-4.2 (the one I have); if you have earlier versions
> please check if it works. It assumes that 'info -o - node1 ...' works;
> without it completing (nested) menu items is more work than it's worth.
> 4 lines of parameter substitution is daunting but it tries to parse
> three different line entry formats with on regexp and also account for
> subtle differences in formatting I have encountered. Suggestions how to
> simplify it are gratefully accepted :-)

I haven't yet tried to work my way into it, but I give the crown for
the most fiendish substitution to you ;-)

> I would be glad to here comments from our completion function gurus (I
> am trying to learn how to write them properly). Specifcially how to use
> tags with _describe (should it be _requested .. && _describe ...?).

_describe has it's own tag handling. It normally uses the tag `values'
or (with the -o option) `options'. One can give it another tag as an
argument after the -t option: _describe -t foos.

I forgot to put that into the docs, it seems, below is a patch.


Index: Doc/Zsh/compsys.yo
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.154
diff -u -r1.154 compsys.yo
--- Doc/Zsh/compsys.yo	8 May 2002 09:11:28 -0000	1.154
+++ Doc/Zsh/compsys.yo	14 May 2002 07:51:52 -0000
@@ -3616,7 +3616,7 @@
 the functions for the fields if they are called.
-item(tt(_describe) [ tt(-o) ] var(descr) var(name1) [ var(name2) ] var(opts) ... tt(-)tt(-) ...)(
+item(tt(_describe) [ tt(-o) | tt(-t) var(tag) ] var(descr) var(name1) [ var(name2) ] var(opts) ... tt(-)tt(-) ...)(
 This function is useful for preparing a list of command options or
 arguments, together with their descriptions var(descr), as matches.
 Multiple groups separated by tt(-)tt(-) can be supplied, potentially with
@@ -3639,6 +3639,9 @@
 the tt(prefix-hidden), tt(prefix-needed) and tt(verbose) styles to find out
 if the strings should be added at all and if the descriptions should be
 shown.  Without the `tt(-o)' option, only the tt(verbose) style is used.
+With the tt(-t) option a var(tag) can be specified that should be used
+instead of the default `tt(values)' or, if the tt(-o) option is given,
 If selected by the tt(list-grouped) style, strings with the same
 description will be added in a way that they appear together in the list.

Sven Wischnowsky                          wischnow@xxxxxxxxx

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