zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: Felix Rosencrantz <f_rosencrantz@yahoo.com>
Cc: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: Generating completion functions from XML
Date: Sat, 21 Jul 2001 14:54:12 +0100	[thread overview]
Message-ID: <3B598984.658F86AC@u.genie.co.uk> (raw)
In-Reply-To: <20010721011604.81202.qmail@web10401.mail.yahoo.com>

Felix Rosencrantz wrote:

> There are more options on what flags are exclusive and equivalent,
> and many times this information has to be repeated.

Note that the exclusion lists are not necessarily repeated. An option
listed in the exclusion list is excluded after the option and there are
some commands where the exclusion is dependant on the ordering. I can't
think of much information repetition in the current _arguments syntax.

Another thing we could do is modify GNU gengetopts (which produces C
calls to getopt_long) to additionally output the basis of a completion
function. Whether they would include our change, I don't know with zsh
not being GNU.

> 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.

Have you used XSLT at all? I've used it for some things and it is quite
cunning. If you use XML, I'd recommend you try it with this
transformation in mind. I actually struggled to find a decent program to
do XSL transformations - most of the information on the web relates to
direct browser support yet it makes a lot of sense currently to use XSL
on the server side. libxslt (which needs libxml2) comes with a little
program called xsltproc which is what I have used (and I have a simple
completion for it so I've attached that).

Another thing you might want to think about is if your XML format can
somehow be flexible enough to include support for multiple languages.

It'll be interesting to see but to be honest I'm a bit doubtful that an
XML equivalent will be any easier to modify or understand that the
current script. A gui wizard might do more to easing things but then
that could use the XML. The completion functions may not have gained
much in ease of writing over compctls (and as you said this is largely
because of the provision greater functionality) but I think they are a
lot more readable. I could never remember all the compctl flags and
always needed the manual to write them whereas tcsh completes were easy.

Oliver

#compdef xsltproc

_arguments -C \
  -v --{verbose,timing,repeat,debug,novalid,noout,maxdepth} \
  '1:stylesheet:_files -g \*.xsl' \
  ':file:_files -g \*.xml'

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp


  reply	other threads:[~2001-07-21 13:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-21  1:16 Felix Rosencrantz
2001-07-21 13:54 ` Oliver Kiddle [this message]
2001-07-22 20:34   ` Felix Rosencrantz
2001-07-23  4:25     ` Andrej Borsenkow
2001-07-23 10:56       ` Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2001-07-19  1:52 Felix Rosencrantz
2001-07-19  8:56 ` Sven Wischnowsky
2001-07-19 15:48   ` Bart Schaefer
2001-07-19 18:42     ` Adam Spiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B598984.658F86AC@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=f_rosencrantz@yahoo.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).