Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to do completion with read?
- X-seq: zsh-users 2724
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: How to do completion with read?
- Date: Thu, 4 Nov 1999 09:21:35 +0100 (MET)
- In-reply-to: Paul Lew's message of Wed, 3 Nov 1999 10:20:02 -0800 (PST)
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
Paul Lew wrote:
> >>>>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author