From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16064 invoked from network); 19 Jul 2001 15:50:52 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Jul 2001 15:50:52 -0000 Received: (qmail 21187 invoked by alias); 19 Jul 2001 15:50:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15422 Received: (qmail 21129 invoked from network); 19 Jul 2001 15:50:40 -0000 From: "Bart Schaefer" Message-Id: <1010719154854.ZM4013@candle.brasslantern.com> Date: Thu, 19 Jul 2001 15:48:54 +0000 In-Reply-To: <200107190856.KAA08273@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: Generating completion functions from XML" (Jul 19, 10:56am) References: <200107190856.KAA08273@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: Generating completion functions from XML MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net