Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: dynamic reset of completion widget
- X-seq: zsh-users 8176
- From: Francisco Borges <borges@xxxxxxxxxx>
- To: Zsh User <zsh-users@xxxxxxxxxx>
- Subject: Re: dynamic reset of completion widget
- Date: Thu, 4 Nov 2004 21:54:00 +0100
- In-reply-to: <11332.1099573781@xxxxxxx>
- Mail-followup-to: Zsh User <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Alfa Informatica - Rijksuniversiteit Groningen
- References: <20041104124224.GA9979@xxxxxxxxxx> <11332.1099573781@xxxxxxx>
» 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 make
> _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
>
> _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.
> $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=$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?
Peace,
--
Francisco Borges
Alfa Informatica - RuG
Messages sorted by:
Reverse Date,
Date,
Thread,
Author