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

Re: Generating completion functions from XML



>Btw. have you noticed Bart's _arg_compile function?

I hadn't looked at Bart's _arg_compile function.  It does look
interesting.  It covers things that I would like to see in an
intermediate file format.

XML is sort of interesting to me for the intermediate format for all the
reasons that people are hyping it these days.  It might not be the way
to go, but it's worth a try.  I do agree that XML is not overly easy to
edit (I haven't looked at psgml.el).  Though, I like the possibility of
actually placing documentation in appropriate points in the descriptive
file, and the ability for it to be modified more programmatically.

Also, I don't really expect XML to represent all completion functions.
Though for many simple ones, I think XML could be a good format.

I'll take a first stab at coming up with some sort of grammar.  I've
only created a couple small grammars for some small projects.  I know
though that it can take some effort to design a good schema.

I'd like to see an XML format that can represent any _arguments call.
So that it would be possible to have some sort of equivalent version in
XML.

I'd also like to be able to represent/generate a function that contains
multiple _argument calls based on $service, and then can also handle
$state (e.g. the _zip function).

>But it's not simple to define, really.  Especially if you think about
>commands like _cvs which does *a lot* besides calling _arguments,
>things that are best described with the shell code needed to do them, I
>think.

With a _cvs-like command I'd like to be able to represent in XML what
amounts to the hierarchical call to _arguments.  I realize there is a
lot of specialized code to handle actions.  I don't really see a way
to automate action generation or to represent actions other than in
zsh script.  (Though there is an XML version of java code, javaml...)
I think if the XML format made it simple to share flags between the
various sub-commands, since it is common for the same flag to be shared
among sub-commands, it would help with the creation of such completion
functions.  

>I'll try to make helpful comments when you start describing the
>language you have in mind.

That would be very much appreciated.  I'll try to come up with something
over the next week.

-FR


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



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