From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28231 invoked from network); 5 Dec 2003 11:04:52 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Dec 2003 11:04:52 -0000 Received: (qmail 8863 invoked by alias); 5 Dec 2003 11:04:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19277 Received: (qmail 8852 invoked from network); 5 Dec 2003 11:04:34 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 5 Dec 2003 11:04:34 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 5 Dec 2003 11:4:33 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-3.tower-36.messagelabs.com!1070622271!2300986 X-StarScan-Version: 5.1.13; banners=-,-,- Received: (qmail 4297 invoked from network); 5 Dec 2003 11:04:31 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-3.tower-36.messagelabs.com with SMTP; 5 Dec 2003 11:04:31 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id hB5B4VuB029923 for ; Fri, 5 Dec 2003 11:04:31 GMT Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id hB5B8S202689 for ; Fri, 5 Dec 2003 12:08:28 +0100 X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1031119171855.ZM11248@candle.brasslantern.com> From: Oliver Kiddle References: <20031106153225.GA491@lorien.emufarm.org> <1281.1068232665@athlon> <20031110182013.GA20547@lorien.emufarm.org> <9219.1068538977@gmcs3.local> <20031111162338.GD23138@lorien.emufarm.org> <901.1068577572@athlon> <20031111212828.GA28125@lorien.emufarm.org> <29114.1068797096@gmcs3.local> <20031114154608.GA6959@lorien.emufarm.org> <15744.1069084060@gmcs3.local> <20031117175151.GA24060@lorien.emufarm.org> <29608.1069237406@gmcs3.local> <1031119171855.ZM11248@candle.brasslantern.com> To: zsh-workers@sunsite.dk Subject: Re: compadd option passing (Re: Completion function for bitkeeper?) Date: Fri, 05 Dec 2003 12:08:28 +0100 Message-ID: <2687.1070622508@gmcs3.local> I sent this two weeks ago and just realised that it never turned up on the mailing list. Bart wrote: > } I agree that it isn't ideal. The best alternative I can think of would > } be to pass compadd options to the various tag handling functions > } instead of the completion functions. > > That makes it harder for people writing simple completion functions to > make use of the compadd options, though. Maybe that never comes up, but > it seems an unnecessary limitation. True. But it could help other issues by doing more of the hard work with picking out suffixes and descriptions and passing on only the right stuff. Auto-removable suffixes especially stand to benefit if we can store them at each stage. It needs a lot more thought though. > I suggest instead that we choose a single option (or other syntactic > marker) that is documented as being passed to completion functions to > delimit the compadd options from the any options of the function itself. > E.g. soemthing like "everything between -o and a bare '-' is a compadd > option": > Alternately always pass the compadd options in an array parameter, and Either do avoid name clashes but, to be honest, with all of this I think either of those solutions are uglier than the situation we have at the moment. If we really want to clear it up in such a way, How about a single `-' argument be defined as the start of (or end of?) compadd options. So you have to use for example. _sccs_files -e - -X 'sccs file' If there is no `-' argument, it can assume that all options are compadd options (which will be most function calls anyway). _all_labels already looks for `-' in deciding where to put compadd options so it'd also be the easiest to implement. A possibility included in this is that we only do anything special for `-' in _arguments actions (to clear up our initial space vs. { ... } confusion). Oliver