From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2779 invoked from network); 4 Nov 1999 09:34:17 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Nov 1999 09:34:17 -0000 Received: (qmail 21948 invoked by alias); 4 Nov 1999 08:21:37 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2724 Received: (qmail 21941 invoked from network); 4 Nov 1999 08:21:36 -0000 Date: Thu, 4 Nov 1999 09:21:35 +0100 (MET) Message-Id: <199911040821.JAA11534@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-users@sunsite.auc.dk In-reply-to: Paul Lew's message of Wed, 3 Nov 1999 10:20:02 -0800 (PST) Subject: Re: How to do completion with read? Paul Lew wrote: > >>>>> "Bart" == Bart Schaefer writes: > > Bart> Here's my "zleread" function again. Insert some commands to > Bart> fiddle with the completion context just before the call to > Bart> "vared" and you can get it to complete any way you like. > > Thanks for the script. I'm guessing what you mean by fiddle with the > completion context is to create a temporary directory and create dummy > files for completion purpose? So there is no mechanism to pass > zcompctl arguments to vared? Seems vared only complete filename? Actually, `vared' completes its line in the same way a command line is completed. I.e. it uses all the `compctl' definitions you have (including the one for `-C' for the first word on the line). What Bart probably meant was that with the new completion system in version 3.1.6 you can set the parameter `compcontext' in such a function to specify how words in the line read should be completed. Since you seem to use an older version: if your version already supports the `-T' flag to `compctl' (which is quite old), you can use that to say what should be completed in such a function, e.g.: compctl -Tk '(foo bar baz)' vared line compctl -T ... # reset to standard value Resetting it should be possible by first storing the output of `compctl -LT' and later `eval'ing it (be careful if that contains quotes). If you are using a 3.1.6, you'll have to add a `-tn' to the first `compctl -T'. But then... if you are using 3.1.6, you probably should think about moving to the function based completion system anyway. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de