From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2798 invoked from network); 19 Nov 2003 10:20:18 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Nov 2003 10:20:18 -0000 Received: (qmail 6973 invoked by alias); 19 Nov 2003 10:19:51 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6785 Received: (qmail 6928 invoked from network); 19 Nov 2003 10:19:51 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 19 Nov 2003 10:19:51 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 19 Nov 2003 10:19:50 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-5.tower-36.messagelabs.com!1069237189!1930015 X-StarScan-Version: 5.1.13; banners=-,-,- Received: (qmail 10969 invoked from network); 19 Nov 2003 10:19:49 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-5.tower-36.messagelabs.com with SMTP; 19 Nov 2003 10:19:49 -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 hAJAJmXh009723; Wed, 19 Nov 2003 10:19:49 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 hAJANQ529610; Wed, 19 Nov 2003 11:23:26 +0100 cc: zsh-users@sunsite.dk X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20031117175151.GA24060@lorien.emufarm.org> 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> To: Danek Duvall Subject: Re: Completion function for bitkeeper? Date: Wed, 19 Nov 2003 11:23:26 +0100 Message-ID: <29608.1069237406@gmcs3.local> Danek Duvall wrote: > As it is, even with zparseopts (which I hadn't known about, so thank you > for that), there's no way at all to tell whether a -e that's passed to > my helper function is there because I passed it in explicitly through an > argument to _arguments, or whether it's part of the set of arguments > that's destined only for compadd. There's simply no way for me to know. -e will only ever be there if you passed it explicitly. Though -e is an option to compadd, it really wouldn't make sense to pass it to a completion function. So you're safe with -e. Admittedly you would not be safe had you chosen -x. > So then the onus is on me to pick a flag that compadd doesn't already > use. It uses seventeen uppercase letters, thirteen lowercase letters, > and two numbers, and that's a pretty severe depletion of the usable > namespace of flags. But assuming I choose one (and it's even remotely A good few are safe to use: -a, -k, -f, -e, -W and -U are all safe. I'm not sure about some such as -l, -Q, -C and -E without looking in more detail. That perhaps should be documented somewhere. > mnemonic), then there's no guarantee that a future release doesn't add a > new flag to compadd, and bites me in the ass! No there isn't but no compadd options have been added in a long while. We can do a search on distributed functions if we do ever add one. > So while I understand your explanation, my question of how to do this > right is still going unanswered. I think I've now explained how best to do this given the constraints of the completion system as it currently stands. 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. Tag loops need rethinking anyway and that isn't a trivial job. Discussion of possible changes to compsys should go to zsh-workers, though. Oliver