From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8128 invoked from network); 15 Mar 2000 09:59:30 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Mar 2000 09:59:29 -0000 Received: (qmail 19754 invoked by alias); 15 Mar 2000 09:59:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10147 Received: (qmail 19582 invoked from network); 15 Mar 2000 09:59:00 -0000 Date: Wed, 15 Mar 2000 10:58:40 +0100 (MET) Message-Id: <200003150958.KAA15835@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Oliver Kiddle's message of Tue, 14 Mar 2000 19:39:40 +0000 Subject: Re: PATCH: Re: Saving the zle display stuff Oliver Kiddle wrote: > Sven Wischnowsky wrote: > > > > Oliver Kiddle wrote: > > > > I seem to have some fairly long option exclusion lists in some of my > > > completions so it might also be worth thinking if there are any better > > > ways of doing the completion when there are separate forms of the > > > command. I experimented with a few things like using two calls to > > > _arguments without much success. > > > > Yep. Any suggestions? ;-) > > I've got some ideas but I'm not sure how workable they would be. > > First, I suppose we would need some syntax to divide the arguments to > _arguments into separate groups. At a simple level, you could say that > each group defined the options for a separate form of the command and > use something like '--' to separate the groups. The main additional > functionality that this would offer over the current situation is that > you could define separate non-option arguments (*:... or n:...) for each > group. `--' is alredy used for the automatic long-option stuff. > ... > > In summary, this is grouping the arguments and using common exclusion > lists for the groups and allowing the groups to exclude other whole > groups. You could easily expand the above to have longer exclusion lists > and use the current syntax (although you couldn't deal with two -e and > two * definitions). The douled -e is indeed a problem. For one, _arguments currently can't report multiple actions (and is happy with the first one it finds if it finds one). That can probably be changed (I'm not exactly sure how complicated this would be). But of course, this would give us the same problem as for _alternative: the ->state actions. _arguments simply cannot execute more than one of these because it doesn't execute them at all. Maybe that could be changed to report all states that have to be used to the caller, but then every function using multiple sets and ->state has to be able to deal with that (rows of `if's instead of one `case' or a `case' in a loop). Hm. Maybe a wrapper (_multi_arguments) that turns these grouping stuff into normal _arguments descriptions (as you suggested) and then an option to _arguments to allow it to deal with multiply given options. And a way to say which of the multiple descriptions for the same option is mutually exclusive, of course. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de