From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18016 invoked from network); 1 Dec 1996 19:20:29 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 1 Dec 1996 19:20:29 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA07594; Sun, 1 Dec 1996 13:54:39 -0500 (EST) Resent-Date: Sun, 1 Dec 1996 13:54:39 -0500 (EST) From: Zefram Message-Id: <19984.199612011855@stone.dcs.warwick.ac.uk> Subject: Re: what should compctl's look like? To: coleman@math.gatech.edu (Richard Coleman) Date: Sun, 1 Dec 1996 18:54:59 +0000 (GMT) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199612011808.NAA28822@redwood.skiles.gatech.edu> from "Richard Coleman" at Dec 1, 96 01:08:47 pm X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8508.94 X-US-Congress: Moronic fuckers Content-Type: text Resent-Message-ID: <"vSMnf.0.as1.fHTeo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2513 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >I agree with this. Essentially compctl is a 'language within a language'. >It would be nice to see this 'language' developed to be something less >cryptic. What what should it look like? Aha, Richard once again hits the nail right on the head. That is exactly the question that I have been considering with respect to compctls. >Maybe someone could do some experiments with flex/lex and >yacc/bison to see what might work. I think we should avoid having a completely separate language. We already have an expressive general-purpose language -- the shell command language itself. I envisage an interface along these lines: zcompctl ' : some commands # (much like trap really) if [[ $WORD[2] == *z* ]]; then zcompctl -R *.(tgz|taz|tar.(gz|z|Z)) else zcompctl -R *.tar fi ' tar That is, the commands given in that first argument are executed as zsh commands, and can register possible completions with an option to the zcompctl command. (Can anyone think of a better name for the command?) Access to the command line can be through an interface intended for ZLE extension (another project I have some plans for). The only problem with using the shell language is that, due to $IFS and so on, it would be difficult to optimise the simplest cases, as we must do for efficiency. And interpreting shell commands for even moderately complex compctls, currently done with the -x option to compctl, would be inefficient. Does anyone have any better ideas? -zefram