From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9203 invoked from network); 4 Jul 2000 08:06:03 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Jul 2000 08:06:03 -0000 Received: (qmail 5619 invoked by alias); 4 Jul 2000 08:05:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12156 Received: (qmail 5598 invoked from network); 4 Jul 2000 08:05:12 -0000 Date: Tue, 4 Jul 2000 10:04:59 +0200 (MET DST) Message-Id: <200007040804.KAA07882@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Mon, 3 Jul 2000 17:30:03 +0000 Subject: Re: PATCH: Problem with _expand, _path_files, and $(command) Bart Schaefer wrote: > On Jul 3, 11:01am, Sven Wischnowsky wrote: > } Subject: Re: PATCH: Problem with _expand, _path_files, and $(command) > } > } > } > zagzig[88] echo $(exit 0) > } > } > zagzig[88] echo \$\*\(exit\ 0Om\) > } > } Maybe just change the patterns in lines 120, 122, 166 and 168 > } from `(?*)' to `(*[^\$])'? (Haven't tried...) > > Not quite; I also had to change the patterns on lines 153 and 154. > > zagzig[95] echo $(exit 0) > No matches for `file' or `corrections' Is the eval in line 324 still needed? I found another one: completion after something like `../$[4+]/' reported an error because it's a math error and math expressions are parsed later (after paramsubst() has returned). Blah. Very ugly. For now I had to add some $(print...)s, does anyone see a better solution? Bye Sven Index: Completion/Core/_expand =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v retrieving revision 1.24 diff -u -r1.24 _expand --- Completion/Core/_expand 2000/07/02 17:21:54 1.24 +++ Completion/Core/_expand 2000/07/04 08:04:22 @@ -61,9 +61,9 @@ zstyle -T ":completion:${curcontext}:" substitute; then [[ ! -o ignorebraces && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]] && eval exp\=\( ${${(q)exp}:gs/\\{/\{/:gs/\\}/\}/} \) - exp=( ${${(e)exp//\\[ + exp=( $(print -r ${${(e)exp//\\[ ]/ }//(#b)([ -])/\\$match[1]} ) 2>/dev/null +])/\\$match[1]}) ) 2>/dev/null else exp=( ${exp:s/\\\$/\$} ) fi @@ -95,7 +95,7 @@ zstyle -s ":completion:${curcontext}:" keep-prefix tmp || tmp=changed if [[ "$word" = [\~\$]*/* && "$tmp" = (yes|true|on|1|changed) ]]; then - epre=( ${(e)~${word%%/*}} ) + epre=( $(print -r ${(e)~${word%%/*}}) ) 2>/dev/null if [[ -n "$epre" && $#epre -eq 1 ]]; then opre="${word%%/*}" pre="$epre[1]" Index: Completion/Core/_path_files =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v retrieving revision 1.24 diff -u -r1.24 _path_files --- Completion/Core/_path_files 2000/07/03 17:45:47 1.24 +++ Completion/Core/_path_files 2000/07/04 08:04:22 @@ -247,10 +247,9 @@ # after the first slash after the parameter expansion. # This fails for things like `f/$foo/b/' where the first `f' is # meant as a partial path. - linepath="${(M)pre##*\$[^/]##/}" - realpath=${(e)~linepath} - [[ "$realpath" = "$linepath" ]] && return 1 + realpath=$(print -r ${(e)~linepath}) 2>/dev/null + [[ -z "$realpath" || "$realpath" = "$linepath" ]] && return 1 pre="${pre#${linepath}}" i="${#linepath//[^\\/]}" orig="${orig[1,(in:i:)/][1,-2]}" -- Sven Wischnowsky wischnow@informatik.hu-berlin.de