From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11230 invoked from network); 30 Sep 1997 06:57:08 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 30 Sep 1997 06:57:08 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id CAA05531; Tue, 30 Sep 1997 02:44:21 -0400 (EDT) Resent-Date: Tue, 30 Sep 1997 02:44:21 -0400 (EDT) Date: Tue, 30 Sep 1997 08:44:42 +0200 Message-Id: <9709300644.AA08755@gamma.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@math.gatech.edu In-Reply-To: "Bart Schaefer"'s message of Mon, 29 Sep 1997 21:57:19 -0700 Subject: Re: compctl -Tx 'w[0,...] ...' ... Resent-Message-ID: <"jk2NA1.0.MM1.4_9Cq"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3541 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" wrote: > ... > > What I want is a completion that applies to *all* commands, as do -D and > -T, but that is triggered *after* any other completion provided for any > specific command. I guess I could get the effect by altering every other > completion I ever define to end with the "continue using default" switch; > but that means keeping my own edited copies of all the examples from the > zsh dist, etc. > (That's what I meant.) After implementing the `+' style completion and using it for some time I was thinking about adding a option for automatically using `-D' completion if everything failed. But then Bas described how he got used to using `+' at the end of almost all his compctls and noone really complained about missing such a feature. It was quite easy to implement (and I even had it in one of my private version), but it was the time when many people were saying things like `let's keep zsh small, no more options, ...', so I hesitated to suggest it. > > ... (using pattern matching to select a compctl) ... > > I'm pretty sure I requested it myself ... an example would be to set up a > compctl so that every command matching `x*' would accept the standard X > toolkit completions (-display, -xrm, etc.). The reason it might be hard > is because you could end up with multiple different compctl lines that > match the same command: > > compctl -k '(-display -geometry -xrm)' x* > compctl -k hosts xhosts > > How would the ambiguity be resolved? > (Maybe your request just failed to wake me up...) Still I think it wouldn't be too hard to implement. The code already has some `if no matches found, try again with...' in it. So the above would turn into: try to find the command name in the compctl hashtable, if it can't be found, just look at all hashtable entries (optimised to use only entries with patterns, determined at definition time), see if they match the current command name and if they do, try them to produce matches. This could also be used to try multiple pattern-compctls until one produces matches, whereas the `-Tx W[..]' thing would only use the flags of the first matching `W[...]'. One problem may be that the compctls are (of course) in no particular order... Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de