From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29920 invoked from network); 14 Jul 1998 01:55:51 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 14 Jul 1998 01:55:51 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id VAA29737; Mon, 13 Jul 1998 21:48:08 -0400 (EDT) Resent-Date: Mon, 13 Jul 1998 21:44:20 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980713184510.ZM3653@candle.brasslantern.com> Date: Mon, 13 Jul 1998 18:45:10 -0700 In-Reply-To: Comments: In reply to Heinz Deinhart "Re: completion & read, vared" (Jul 13, 8:19pm) References: X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Heinz Deinhart Subject: Re: completion & read, vared Cc: zsh-users@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"xqBi63.0.6F7.lVhgr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1672 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 13, 8:19pm, Heinz Deinhart wrote: > Subject: Re: completion & read, vared > > > On Mon, 13 Jul 1998, Bart Schaefer wrote: > > > On Jul 13, 1:10pm, Heinz Deinhart wrote: > > } Subject: completion & read, vared > > } > > } is there a way to use completion with any realine-like function ? > > > > Not directly; "read" inputs characters one at a time, for some reason, > > even when not in raw mode. > > hmm, maybe i'm missing something, but No, it is I that missed something. You meant "... use completion with _every_ readline-like function?" I parsed "... use completion with one of the readline-like functions?" The answer to the former question is, no, there isn't. The answer I gave was to invent a readline-like function that uses vared to perform completion, which may be interesting but isn't what you wanted. > > } vared uses completion, but i cant figure out how to change its behaviour. > > > > Change its behavior how? > > it would be cool if vared had a completion option (maybe -C) > > "vared -p 'enter a username> ' -C '-u' returnvar" > "emp" expands to "emperor" > > ^^^^ the compctl options that vared > should use in input-line Completion within vared appears to work exactly as if it were parsing a command line; e.g. it completes commands in the leftmost word, then does the completions for those commands in succeeding words, etc. Arguably this isn't the most useful behavior. (For more fun, try invoking the binding for run-help while you're doing a vared; the results are not very helpful). To get the effect that you specifically asked for above, you need to change the default completion by using "compctl -T", then restore the default when vared has exited. E.g., compctl -Tx 'W[0,*]' -u vared whatever compctl -T As usual, one can't attempt something like this without running into another zsh oddity. In this case, compctl -T -u is accepted and appears in the "compctl -L" output, but is a no-op. There has to be a -x option and a pattern before -T will do anything at all. The manual says -T "is only useful when combined with extended completion" but here's a case where (a) it's useful WITHOUT extended completion and (b) it fails mysteriously when used in the obvious way. We should strive to prevent this sort of thing. Anyway, 'W[0,*]' means accept anything in word zero (the command position) which is the closest you can get to having no pattern at all.