From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3473 invoked from network); 26 Feb 2004 11:13:57 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Feb 2004 11:13:57 -0000 Received: (qmail 22965 invoked by alias); 26 Feb 2004 11:13:42 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7086 Received: (qmail 22952 invoked from network); 26 Feb 2004 11:13:41 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 26 Feb 2004 11:13:41 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 26 Feb 2004 11:13:41 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-3.tower-36.messagelabs.com!1077794020!4127950 X-StarScan-Version: 5.2.5; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 4273 invoked from network); 26 Feb 2004 11:13:40 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-3.tower-36.messagelabs.com with SMTP; 26 Feb 2004 11:13:40 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i1QBDeCk024016; Thu, 26 Feb 2004 11:13:40 GMT Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id 9AC507858464; Thu, 26 Feb 2004 12:12:55 +0100 (CET) Cc: "zsh-users@sunsite.dk" X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: From: Oliver Kiddle References: To: Eric Mangold Subject: Re: Adding new completions to zsh Date: Thu, 26 Feb 2004 12:12:55 +0100 Message-ID: <4023.1077793975@trentino.logica.co.uk> Eric Mangold wrote: > My idea for allowing greater flexibility is to bundle the actual zsh > completion functionality as part of the Twisted distribution and give zsh > a "stub" that will use the completion functions that are bundled with > Twisted. > > Has anyone ever done this before? What do you all think? It's never been done before but it makes some sense. Thinking about how this could work, the function distributed with zsh could start with something like this: local dir FPATH="$FPATH" dir=${commands[twistd]:h:h}/share/twistd if [[ -r $dir/_twistd ]]; then fpath=( $dir $fpath ) autoload -XU fi The dir assignment is a crude way of trying to find the directory containing the function in the twisted distribution. Hopefully you have some hook which will do a better job. It then checks if it has found the function. If so, it adds the directory to beginning of the function search path and uses autoload to load the replacement function. After this section, we could fallback on a potentially out-of-date completion for twistd. It'd be good if the zsh CVS view of that could be kept reasonably up-to-date though. Oliver