zsh-users
 help / color / mirror / code / Atom feed
From: Francisco Borges <borges@let.rug.nl>
To: Zsh User <zsh-users@sunsite.dk>
Subject: Re: dynamic reset of completion widget
Date: Thu, 4 Nov 2004 21:54:00 +0100	[thread overview]
Message-ID: <20041104205400.GA12739@let.rug.nl> (raw)
In-Reply-To: <11332.1099573781@csr.com>

» 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


  reply	other threads:[~2004-11-04 20:56 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 [this message]
2004-11-05 12:11     ` Peter Stephenson
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=20041104205400.GA12739@let.rug.nl \
    --to=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).