From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13906 invoked by alias); 19 Apr 2013 00:54:17 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31273 Received: (qmail 4187 invoked from network); 19 Apr 2013 00:54:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at m.gmane.org designates 80.91.229.3 as permitted sender) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Nicholas Riley Subject: Re: Lazy loading completions Date: Thu, 18 Apr 2013 19:53:59 -0500 Organization: University of Illinois College of Medicine at Urbana-Champaign Message-ID: References: <130418163739.ZM8718__6202.1464844749$1366328467$gmane$org@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-212-151-192.hsd1.il.comcast.net User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) In article <130418163739.ZM8718__6202.1464844749$1366328467$gmane$org@torch.brassla ntern.com>, Bart Schaefer wrote: > compctl has been mostly deprecated for several years. You should look > into running compinit from your shell startup to set up more modern > completions. Yeah, I already do use the modern completions a lot elsewhere. I'm just trying to get this to work here :-) > In fact, someone should suggest to Doug Hellmann that he stop using > compctl commands in virtualenvwrapper.sh ... compctl won't work at all > for someone using compinit unless they've configured it to fall through > to old-style completions when no modern completion is found. Huh, sounds like it's worth a bug report. I don't have any mention of compctl in my compinit but maybe I got lucky. > } source /usr/local/bin/virtualenvwrapper_lazy.sh > } _virtualenvwrapper_load_compctl() { > } compctl + ${=_VIRTUALENVWRAPPER_API} > } virtualenvwrapper_load > } eval ${$(compctl | egrep '^'$_comp_command1' -K')[3]} > } } > > ?? Where is the value of $_comp_command1 coming from here? It's not set > by virtualenvwrapper_load or virtualenvwrapper.sh as far as I can tell, > so that egrep is doing nothing ...? It's being set by the completion system, I guess. I inserted a 'set' into the completion and grabbed the variable which contained the function name whose argument was being completed. In any case, if I can do without it using compdef, I'm all for it... > } compctl -K _virtualenvwrapper_load_compctl ${=_VIRTUALENVWRAPPER_API} > > With compinit loaded, I believe what you want here is > > _virtualenvwrapper_load_compctl() { > unset '_comps['${(k)^_comps[(R)_virtualenvwrapper_load_compctl]}']' > virtualenvwrapper_load > # Until Doug gets his act together > zmodload -i zsh/compctl > zstyle ':completion:*' use-compctl yes > _default > # After togetherness > # _normal > } > compdef _virtualenvwrapper_load_compctl ${=_VIRTUALENVWRAPPER_API} > > but I'm not entirely confident. Works great, thanks, though I now need to move the above to below where I call compinit; that may break a lot of users of virtualenvwrapper. -- Nicholas Riley