Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Problem with _expand, _path_files, and $(command)



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'


Index: Completion/Core/_path_files
===================================================================
@@ -117,9 +117,9 @@
 
     tmp2=()
     for tmp1 in "$pats[@]"; do
-      if [[ "$tmp1" = (#b)(?*)(\(\([^\|~]##\)\)) ]]; then
+      if [[ "$tmp1" = (#b)(*[^\$])(\(\([^\|~]##\)\)) ]]; then
         tmp2=( "$tmp2[@]" "${match[1]}((${sort}${match[2][3,-1]}" )
-      elif [[ "$tmp1" = (#b)(?*)(\([^\|~]##\)) ]]; then
+      elif [[ "$tmp1" = (#b)(*[^\$])(\([^\|~]##\)) ]]; then
         tmp2=( "$tmp2[@]" "${match[1]}(${sort}${match[2][2,-1]}" )
       else
         tmp2=( "$tmp2[@]" "${tmp1}(${sort})" )
@@ -150,8 +150,8 @@
 zstyle -s ":completion:${curcontext}:files" ignore-parents ignpar
 
 if [[ -n "$compstate[pattern_match]" &&
-      ( ( -z "$SUFFIX" && "$PREFIX" = *\([^\|\~]##\) ) ||
-        "$SUFFIX" =  *\([^\|\~]##\) ) ]]; then
+      ( ( -z "$SUFFIX" && "$PREFIX" = (|*[^\$])\([^\|\~]##\) ) ||
+        "$SUFFIX" =  (|*[^\$])\([^\|\~]##\) ) ]]; then
   # Copy all glob qualifiers from the line to
   # the patterns used when generating matches
   if [[ "$SUFFIX" = *\([^\|\~]##\) ]]; then
@@ -163,9 +163,9 @@
   fi
   tmp2=()
   for tmp1 in "$pats[@]"; do
-    if [[ "$tmp1" = (#b)(?*)(\(\([^\|~]##\)\)) ]]; then
+    if [[ "$tmp1" = (#b)(*[^\$])(\(\([^\|~]##\)\)) ]]; then
       tmp2=( "$tmp2[@]" "${match[1]}((${tmp3}${match[2][3,-1]}" )
-    elif [[ "$tmp1" = (#b)(?*)(\([^\|~]##\)) ]]; then
+    elif [[ "$tmp1" = (#b)(*[^\$])(\([^\|~]##\)) ]]; then
       tmp2=( "$tmp2[@]" "${match[1]}(${tmp3}${match[2][2,-1]}" )
     else
       tmp2=( "$tmp2[@]" "${tmp1}(${tmp3})" )

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author