From: Peter Stephenson <pws@csr.com>
To: Francisco Borges <borges@let.rug.nl>
Cc: Zsh User <zsh-users@sunsite.dk>
Subject: Re: dynamic reset of completion widget
Date: Fri, 05 Nov 2004 12:11:52 +0000 [thread overview]
Message-ID: <8103.1099656712@csr.com> (raw)
In-Reply-To: <20041104205400.GA12739@let.rug.nl>
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 <pws@csr.com> 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
**********************************************************************
next prev parent reply other threads:[~2004-11-05 12:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-04 12:42 Francisco Borges
2004-11-04 13:09 ` Peter Stephenson
2004-11-04 20:54 ` Francisco Borges
2004-11-05 12:11 ` Peter Stephenson [this message]
2004-11-04 18:39 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8103.1099656712@csr.com \
--to=pws@csr.com \
--cc=borges@let.rug.nl \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).