From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26217 invoked from network); 4 Nov 2004 20:56:11 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Nov 2004 20:56:11 -0000 Received: (qmail 78178 invoked from network); 4 Nov 2004 20:56:05 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Nov 2004 20:56:05 -0000 Received: (qmail 4591 invoked by alias); 4 Nov 2004 20:55:56 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8176 Received: (qmail 4581 invoked from network); 4 Nov 2004 20:55:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Nov 2004 20:55:55 -0000 Received: (qmail 77164 invoked from network); 4 Nov 2004 20:55:55 -0000 Received: from dep.let.rug.nl (129.125.8.60) by a.mx.sunsite.dk with SMTP; 4 Nov 2004 20:55:54 -0000 Received: from dep.let.rug.nl ([129.125.8.60]) by dep.let.rug.nl (SAVSMTP 3.1.0.29) with SMTP id M2004110421555201754 for ; Thu, 04 Nov 2004 21:55:52 +0100 Received: from loki (postfix@loki.let.rug.nl [129.125.8.86]) by dep.let.rug.nl (8.12.10/8.12.10) with ESMTP id iA4KtpkG022328 for ; Thu, 4 Nov 2004 21:55:51 +0100 (MET) Received: by loki (Postfix, from userid 7006) id 6F6C2EDAF; Thu, 4 Nov 2004 21:54:02 +0100 (CET) Date: Thu, 4 Nov 2004 21:54:00 +0100 From: Francisco Borges To: Zsh User Subject: Re: dynamic reset of completion widget Message-ID: <20041104205400.GA12739@let.rug.nl> Mail-Followup-To: Zsh User References: <20041104124224.GA9979@let.rug.nl> <11332.1099573781@csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <11332.1099573781@csr.com> X-Operating-System: Linux/2.6.8-1-686 (i686) X-Editor: GNU Emacs 21.3.50.2 Organization: Alfa Informatica - Rijksuniversiteit Groningen User-Agent: Mutt/1.5.6+20040722i X-Whitelist: OK X-Scanned-By: milter-spamc/0.25.321 (dep.let.rug.nl [129.125.8.60]); Thu, 04 Nov 2004 21:55:52 +0100 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by dep.let.rug.nl id iA4KtpkG022328 X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 =BB On Thu, Nov 04, 2004 at 01:09:41PM +0000, Peter Stephenson wrote: > You might want to make it a bit more flexible about possible > enchancements by providing a few extra support functions in parallel to > _optparse (just put #autoload at the top of each function) and then mak= e > _foo.py use those. It gives you a little bit more decoupling between > the versions of zsh and the versions of the python script. It depends > how complicated _foo.py is going to be; if you're simply going to call > _arguments, for example, maybe there's no point. However, having your > own _optparse_arguments as a front-end whose initial implementation is > simply >=20 > _optparse_arguments() { _arguments "$@"; } >=20 > allows you a bit of future-proofing. Hum, I can't say I understood what you meant to say here. What I can tell you is that so far, I'm only using _arguments.=20 > $service ought to give you this immediately. In general it's It did, thanks :-) I have another problem, everytime I complete on foo.py, everything seems to go fine but _optparse is still the widget used to complete the script, e.g. the python script is called everytime I need to complete. So I guess I'm not actually rebinding... The function I'm using is: Any hints on how to get this right? #autoload _optparse(){ bar=3D$service eval "`$bar --optcomp-on-the-fly`" if [[ -z $functions[_$bar] ]]; then _message "$bar --optcomp-on-the-fly didn't define _$bar" return 1 fi compdef _$bar $bar _$bar "$@" } BTW, how can I see which widget is being used to complete a command?=20 Peace, --=20 Francisco Borges Alfa Informatica - RuG