From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19626 invoked from network); 3 May 2000 11:49:32 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 May 2000 11:49:32 -0000 Received: (qmail 10165 invoked by alias); 3 May 2000 11:49:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11110 Received: (qmail 10152 invoked from network); 3 May 2000 11:49:05 -0000 Date: Wed, 3 May 2000 13:49:01 +0200 (MET DST) Message-Id: <200005031149.NAA31380@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Wed, 3 May 2000 10:39:21 +0000 Subject: Re: Globbing and RC_EXPAND_PARAM Bart Schaefer wrote: > On May 3, 10:41am, Sven Wischnowsky wrote: > } Subject: Re: Globbing and RC_EXPAND_PARAM > } > } Not very nice either: *(/e:REPLY=-I\$REPLY) > } > } Whoa! Dirty tricks ;-) > > zagzig[86] echo *(/e:REPLY=-I\$REPLY) > zsh: missing end of string Sorry... > zagzig[87] echo *(/e:REPLY=-I\$REPLY:) > -ICVS -ICompletion -IConfig -IDoc -IEtc -IFunctions -IMisc -ISrc -IStartupFiles > -ITest -IUtil > > Pretty cool, but one can play hell with _expand this way ... > > zagzig[91] echo Completion/*(/e:REPLY=-I\$REPLY:) > zagzig[91] echo -I$REPLY -I$REPLY -I$REPLY -I$REPLY -I$REPLY -I$REPLY -I$REPLY > -I$REPLY -I$REPLY -I$REPLY -I$REPLY > Completing all expansions > -I$REPLY -I$REPLY -I$REPLY -I$REPLY -I$REPLY -I$REPLY -I$REPLY -I$REPLY > -I$REPLY -I$REPLY -I$REPLY > Completing expansions > -I$REPLY > Completing original > Completion/*(/e:REPLY=-I\$REPLY:) With `substitute' set to zero, yes. Hrmpf, the ${(e)...} neatly removes the backslash before the `$'. Since that isn't special to globbing, I think we should just add to code to remove such backslashes when `substitute' is zero. And then I noticed that complist had a problem with clearing the end of the previously shown list in a menu selection when the prompt went from spanning multiple lines to only one line. Again. An off-by-one error. Bye Sven Index: Completion/Core/_expand =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v retrieving revision 1.7 diff -u -r1.7 _expand --- Completion/Core/_expand 2000/05/02 15:52:44 1.7 +++ Completion/Core/_expand 2000/05/03 11:48:31 @@ -35,11 +35,14 @@ # changes quoted spaces, tabs, and newlines into spaces and protects # this function from aborting on parse errors in the expansion. -{ zstyle -s ":completion:${curcontext}:" substitute expr || - { [[ "$curcontext" = expand-word:* ]] && expr=1 } } && - [[ "${(e):-\$[$expr]}" -eq 1 ]] && - exp=( ${(f)"$(print -lR - ${(e)exp//\\[ +if { zstyle -s ":completion:${curcontext}:" substitute expr || + { [[ "$curcontext" = expand-word:* ]] && expr=1 } } && + [[ "${(e):-\$[$expr]}" -eq 1 ]]; then + exp=( ${(f)"$(print -lR - ${(e)exp//\\[ ]/ })"} ) 2>/dev/null +else + exp=( "${exp:s/\\\$/\$}" ) +fi # If the array is empty, store the original string again. @@ -117,7 +120,7 @@ if [[ -d "$i" && "$i" != */ ]]; then dir=( "$dir[@]" "$i" ) else - normal=( "$dir[@]" "$i" ) + normal=( "$normal[@]" "$i" ) fi done (( $#dir )) && compadd "$expl[@]" -UQ -qS/ - "$dir[@]" Index: Src/Zle/complist.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v retrieving revision 1.12 diff -u -r1.12 complist.c --- Src/Zle/complist.c 2000/04/28 07:39:08 1.12 +++ Src/Zle/complist.c 2000/05/03 11:48:32 @@ -985,7 +985,7 @@ lastml = 0; } cl = (listdat.nlines > lines - nlnct - mhasstat ? - lines - nlnct - mhasstat : listdat.nlines); + lines - nlnct - mhasstat : listdat.nlines) - 1; mrestlines = lines - 1; if (cl < 2) { -- Sven Wischnowsky wischnow@informatik.hu-berlin.de