From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18353 invoked from network); 15 Feb 2000 11:35:01 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Feb 2000 11:35:01 -0000 Received: (qmail 1617 invoked by alias); 15 Feb 2000 11:34:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9741 Received: (qmail 1609 invoked from network); 15 Feb 2000 11:34:54 -0000 Date: Tue, 15 Feb 2000 12:34:53 +0100 (MET) Message-Id: <200002151134.MAA11836@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Oliver Kiddle's message of Tue, 15 Feb 2000 11:09:18 +0000 Subject: Re: help with _match, globcomplete etc. Oliver Kiddle wrote: > Sven Wischnowsky wrote: > > > You can bind expand-word to ^X$. > > True though I was mainly after not having variable expansion ever when I > press tab. > > Incidentally, I tried creating: > expand-variables() { > setopt localoptions noglob > zle expand-word > } > zle -N expand-variables Why use expand-word at all then? Modified from a widget that appeared on the users list some time ago: expand-variables() { local skip="${(M)LBUFFER%%[ \;\|\{\}]##}" local word="${(M)${LBUFFER%${skip}}%%[^ \;\|\{\}]##}" exp exp=${(e)word} [[ -n "$exp" ]] && LBUFFER="${LBUFFER%${word}${skip}}${exp}${skip}" } zle -N expand-variables Or some such. > so that ^X$ wouldn't also glob complete but it comes back with any glob > characters quoted. It seems that expand-word always does this when > noglob is set. Surely this isn't right? In the process, I also noticed > that the quoting can go slightly wrong if there are opened but not > closed braces: $code[ai]/{a,b comes back with a quoted '[' in > the middle. Maybe I'll have a look some time... > > Have you had a look at the _expand completer? And the _expand_word > > I have now but I can't get it to work. I've probably missed something > but this won't work: > > zsh -f > autoload -U compinit > compinit > bindkey '^I' complete-word > zstyle -d > zstyle ':completion:*::::' completer _expand > echo * > > I was expecting the last line to glob expand (as if tab was still bound > to expand-or-complete) but all I can get is a beep. I've tried changing > the related styles without any effect. Setting `zstyle ':completion:*:expand:*' glob 1' works for me. It is a bit irritating that you have to switch on at least one style to make _expand do anything... Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de