From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2215 invoked from network); 25 Jul 2000 15:39:55 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Jul 2000 15:39:55 -0000 Received: (qmail 7237 invoked by alias); 25 Jul 2000 15:39:30 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3334 Received: (qmail 7229 invoked from network); 25 Jul 2000 15:39:28 -0000 From: "Bart Schaefer" Message-Id: <1000725153922.ZM20015@candle.brasslantern.com> Date: Tue, 25 Jul 2000 15:39:22 +0000 In-Reply-To: <200007251314.OAA90882@cm01.ess> Comments: In reply to Oliver Kiddle "Completion in the first character position" (Jul 25, 2:14pm) References: <200007251314.OAA90882@cm01.ess> <200007251339.PAA08266@beta.informatik.hu-berlin.de> In-Reply-To: <200007251339.PAA08266@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: Completion in the first character position" (Jul 25, 3:39pm) X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh users Subject: Re: Completion in the first character position MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 25, 2:14pm, Oliver Kiddle wrote: } Subject: Completion in the first character position } } I am writing a shell script where I'm prompting the user to enter } various information. I'm using vared to read what is entered into a } variable after using compctl -C to setup completions (and a setopt } autolist). I could have used the new style completions but it is a } fairly simple case and I use 3.0.8 where the script will run. I have a similar script and a similar situation, but I used compctl -Tx 'p[1,-1]' -f - 'W[0,*]' -k l ${${ZSH_VERSION##3.0*}:+-tn} where `l' holds the list of words to be completed. Hmm, I guess I'm also using a `select' loop to read what is entered, as ZLE is enabled at the PS3 prompt. } The problem is that when I press tab to complete in the first character } position, a tab is inserted and the completions are not listed. Even sillier is that ^D in this same position _does_ produce a list, rather than exiting from `select'. That doesn't appear to be the case any longer with the new completion system. I suppose that might even be worthy of a patch for 3.0.8 ... } Is there an option or something to turn this off? I've looked through } the manual but can't see one. As a feature, it is probably less useful } with the new completion system because the same can be achieved with a } style anyway. On Jul 25, 3:39pm, Sven Wischnowsky replied: } Subject: Re: Completion in the first character position } } Yes, since this is possible in the new completion system (even the } default there, inside vared), I guess we won't add an option for it. My aforementioned script does local curcontext=${0}::: zstyle ":completion:${0}:*" completer _null zstyle ":completion:${0}:*" insert-tab no _null() { compcall -T -D } to bypass new completion after the compctl -Tx has been installed and stop tabs being inserted at the beginnings of lines. Which reminds me: `zed' should do something similar. As should vared when editing an element of the functions assoc -- is there a way to be that specific about the vared context? } bindkey -s '\t' '\ec' # or something better than \ec } bindkey '\ec' complete-word Cute. } And now you wish for vared-local keymaps, of course ;-) The trick used by zed to set and restore bindings should be sufficient. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net