From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13713 invoked from network); 1 Dec 1998 06:38:09 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 1 Dec 1998 06:38:09 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id BAA03935; Tue, 1 Dec 1998 01:33:33 -0500 (EST) Resent-Date: Tue, 1 Dec 1998 01:33:33 -0500 (EST) From: "Bart Schaefer" Message-Id: <981130222847.ZM3321@candle.brasslantern.com> Date: Mon, 30 Nov 1998 22:28:47 -0800 In-Reply-To: <19981201024758.60618@athenaeum.demon.co.uk> Comments: In reply to Phil Pennock "Non-intuitive completion" (Dec 1, 2:47am) References: <19981201024758.60618@athenaeum.demon.co.uk> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Phil Pennock , Zsh Development Workers Subject: Re: Non-intuitive completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"AXgoL2.0.Qz.ysuOs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4691 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Dec 1, 2:47am, Phil Pennock wrote: } Subject: Non-intuitive completion } } Also, this isn't necessarily a bug, as it's 'daft' on my part. But the } results are counter-intuitive, to me at least. } } athenaeum% print $ZSH_* } } At which point the leading $ZSH_ is completely ignored and removed, and } the * is expanded out to files in the current directory, as per usual. } } Nothing special about the above choice of variable, except that } after the Z provides the next three characters. I'm lazy and wanted } both, so tried '*' to see what zsh would do. I /know/ it's a filename } glob, but shouldn't the leading text have some effect instead of being } treated as null? The default binding for tab is expand-or-complete. The $ZSH_ is "treated as null" because as soon as you insert the '*' you aren't doing completion any more, you're doing expansion. The expansion of $ZSH_ is empty if $ZSH_ is not set, so it vanishes. If you don't want to switch on the fly from completion to expansion in that way, then you have to rebind tab to complete-word. Try zsh% bindkey '^I' complete-word zsh% print $ZSH_* Now it just feeps at you, because a '*' can't appear in a variable name. Now, if you'd like to see some REALLY strange behavior, which definitely IS a bug in my book, try zsh% bindkey '^I' expand-or-complete zsh% setopt nounset zsh% print $ZSH_* -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com