Zsh Mailing List Archive
Messages sorted by:
Re: Generating completion functions from XML
- X-seq: zsh-workers 15422
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Generating completion functions from XML
- Date: Thu, 19 Jul 2001 15:48:54 +0000
- In-reply-to: <200107190856.KAA08273@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200107190856.KAA08273@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Jul 19, 10:56am, Sven Wischnowsky wrote:
} Subject: Re: Generating completion functions from XML
} Felix Rosencrantz wrote:
} > So I feared having to look at partially wrong _arguments calls. That
} > command has a lot of syntactic sugar and there is more on the way (e.g.
} > recent changes). It's not easy for me to remember what each special
} > character and grouping does.
} Actually, the reason why some of the _argument calls hurt the eyes is
} that it has so littly syntactic sugar.
} > It occurred to me that having an intermediate file format would be a
} > good idea. Possibly something that would be a little more descriptive,
} > maybe even interspersed with comments and documentation (both from
} > zsh & the command). Also it should be easier to edit. Also, it
} > should make it easier to specify commands that have subcommands (e.g.
} > cvs). There would need to be a tool which transform this intermediate
} > file format into the appropriate completion function, generating the
} > appropriate call to _arguments, _values, etc. Also, as the syntax to
} > _arguments changed it would be possible to change this generation tool,
} > and then regenerate the completion function. Maybe even _arguments
} > could even take this intermediate format file as input.
} Btw. have you noticed Bart's _arg_compile function?
I haven't updated _arg_compile in quite some time; I'm not sure that it
still produces good _arguments calls.
Another possible output format for a more sugary input language may be
Tanaka's _regex_arguments, which presently is used only for the `xset'
and `xwit' commands and the Debian `apt' family of commands. It might
be possible to produce better completions for many commands by using
_regex_arguments, but I confess that trying to comprehend that regex
syntax has always exceeded my available time or attention span.
} I'm not opposed to defining some language to make describing commands
} easier at all. Be it XML or something else (everything has to be XML
} nowadays, right? at least until the next hype... ;-).
That pretty much sums up my feeling about XML. I have yet to find an
editor that makes XML easier to edit than shell code. Maybe I just
haven't tried a recent enough version of emacs, or something.
Bart Schaefer Brass Lantern Enterprises
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by: