From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16560 invoked from network); 6 Jun 2000 13:02:05 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Jun 2000 13:02:05 -0000 Received: (qmail 13750 invoked by alias); 6 Jun 2000 13:01:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11777 Received: (qmail 13740 invoked from network); 6 Jun 2000 13:01:38 -0000 Date: Tue, 6 Jun 2000 14:58:37 +0200 (MET DST) Message-Id: <200006061258.OAA09450@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk CC: Vincent Lefevre In-reply-to: Vincent Lefevre's message of Tue, 6 Jun 2000 11:22:25 +0200 Subject: PATCH: Re: blah*[TAB] (difference between 3.1.6 and 3.1.9) [ moved to -workers and CC'ed to Vincent ] Vincent Lefevre wrote: > On Tue, Jun 06, 2000 at 03:20:38 +0000, Bart Schaefer wrote: > > As a workaround, the following should behave the way you want: > > > > bindkey '\t' complete-word > > autoload -U compinit > > compinit > > zstyle ':completion:*' completer _expand _complete > > zstyle ':completion:*:expand:::' glob 1 > > zstyle ':completion:*:expand:::' substitute 1 > > > > If you have some customized compctl commands, you may also want: > > > > zstyle ':completion:*' use-compctl 1 > > If I use this (at the end of my .zshrc), variable names completion > doesn't work any longer. For instance, I type "echo $ZSH_V": > > Et encore? echo $ZSH_V > > then [TAB], and I get: > > Et encore? echo # > $ZSH_V > > where '#' represents the cursor. The _expand completer offers you the expansion of $ZSH_V (an empty string) and the original and enters menu-completion so that you can toggle between the two (with the `expansion' being inserted in the line immediately). Hm, maybe we shouldn't use `empty' expansions. And if I'm not completely mistaken, that test for add-space should eb the other way round. And to get nearer to the expand-or-complete behaviour, you should also use: zstyle ':completion:*:expand:*' tag-order all-expansions That will make it insert only all the expansions in the line, not allowing you to menu between the original string, the expansions one-by-one and all expansions at once. Bye Sven Index: Completion/Core/_expand =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v retrieving revision 1.13 diff -u -r1.13 _expand --- Completion/Core/_expand 2000/05/31 09:38:26 1.13 +++ Completion/Core/_expand 2000/06/06 12:51:44 @@ -54,7 +54,7 @@ # If the array is empty, store the original string again. -(( $#exp )) || exp=("$word") +[[ -z "$exp" ]] && exp=("$word") subd=("$exp[@]") @@ -92,7 +92,7 @@ if (( $#exp == 1 )); then if [[ -d $exp && "$exp[1]" != */ ]]; then suf=/ - elif zstyle -T ":completion:${curcontext}:" add-space; then + elif ! zstyle -T ":completion:${curcontext}:" add-space; then suf= fi fi -- Sven Wischnowsky wischnow@informatik.hu-berlin.de