From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5152 invoked from network); 5 Nov 2004 12:12:13 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Nov 2004 12:12:13 -0000 Received: (qmail 1790 invoked from network); 5 Nov 2004 12:12:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Nov 2004 12:12:07 -0000 Received: (qmail 1310 invoked by alias); 5 Nov 2004 12:11:57 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8177 Received: (qmail 1297 invoked from network); 5 Nov 2004 12:11:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Nov 2004 12:11:56 -0000 Received: (qmail 755 invoked from network); 5 Nov 2004 12:11:56 -0000 Received: from host81-105-217-43.not-set-yet.ntli.net (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 5 Nov 2004 12:11:54 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id ; Fri, 5 Nov 2004 12:10:45 +0000 Received: from csr.com ([10.102.144.127]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 5 Nov 2004 12:11:13 +0000 To: Francisco Borges cc: Zsh User Subject: Re: dynamic reset of completion widget In-reply-to: <20041104205400.GA12739@let.rug.nl> References: <20041104124224.GA9979@let.rug.nl> <11332.1099573781@csr.com> <20041104205400.GA12739@let.rug.nl> Date: Fri, 05 Nov 2004 12:11:52 +0000 Message-ID: <8103.1099656712@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 05 Nov 2004 12:11:13.0396 (UTC) FILETIME=[8B2BB340:01C4C330] 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=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Francisco Borges wrote: > > _optparse_arguments() { _arguments "$@"; } > > > > 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. If _arguments doesn't change, you don't need to worry. > 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? print $_comps[foo.py] will tell you what function the system will call to handle foo.py. Try adding print "$bar $_comps[$bar]" >/tmp/optparse.dbg after the compdef to see what's going on. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************