about summary refs log tree commit diff
path: root/Completion/Core
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-12 15:26:24 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-12 15:26:24 +0000
commitfe9c48eaf1346d61fe5394c83400f6783db65321 (patch)
treeeacb7d0b6aab5554db2c192eed6c4efa6815c9a0 /Completion/Core
parent961c7a156ee2e31cf5743e85e051dfda11df1d46 (diff)
downloadzsh-fe9c48eaf1346d61fe5394c83400f6783db65321.tar.gz
zsh-fe9c48eaf1346d61fe5394c83400f6783db65321.tar.xz
zsh-fe9c48eaf1346d61fe5394c83400f6783db65321.zip
zsh-workers/9298
Diffstat (limited to 'Completion/Core')
-rw-r--r--Completion/Core/_description16
-rw-r--r--Completion/Core/_main_complete2
-rw-r--r--Completion/Core/_path_files34
3 files changed, 26 insertions, 26 deletions
diff --git a/Completion/Core/_description b/Completion/Core/_description
index c6a7b8807..ffe016df8 100644
--- a/Completion/Core/_description
+++ b/Completion/Core/_description
@@ -1,10 +1,11 @@
 #autoload
 
-local name gropt format gname hidden hide match
+local name gropt format gname hidden hide match ign
 
 gropt=(-J)
 hide=()
 match=()
+ign=()
 
 if [[ "$1" = -([12]|)[VJ] ]]; then
   gropt=("$1")
@@ -29,21 +30,26 @@ zstyle -s ":completion${curcontext}:$1" group-name gname &&
     [[ -z "$gname" ]] && gname="$1"
 zstyle -s ":completion${curcontext}:$1" matcher match &&
     match=(-M "${(q)match}")
+if zstyle -a ":completion${curcontext}:$1" ignored-patterns _comp_ignore; then
+  ign=(-F _comp_ignore)
+else
+  _comp_ignore=()
+fi
 
 shift 2
 [[ -n "$format" ]] && zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}"
 
 if [[ -n "$gname" ]]; then
   if [[ -n "$format" ]]; then
-    eval "${name}=($hide $match $gropt ${(q)gname} -X \"${format}\")"
+    eval "${name}=($hide $match $ign $gropt ${(q)gname} -X \"${format}\")"
   else
-    eval "${name}=($hide $match $gropt ${(q)gname})"
+    eval "${name}=($hide $match $ign $gropt ${(q)gname})"
   fi
 else
   if [[ -n "$format" ]]; then
-    eval "${name}=($hide $match $gropt -default- -X \"${format}\")"
+    eval "${name}=($hide $match $ign $gropt -default- -X \"${format}\")"
   else
-    eval "${name}=($hide $match $gropt -default-)"
+    eval "${name}=($hide $match $ign $gropt -default-)"
   fi
 fi
 
diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete
index 53af97dab..09feae10f 100644
--- a/Completion/Core/_main_complete
+++ b/Completion/Core/_main_complete
@@ -19,7 +19,7 @@
 setopt localoptions nullglob rcexpandparam extendedglob
 unsetopt markdirs globsubst shwordsplit nounset ksharrays
 
-local comp post ret=1 _compskip _prio_num=1 format \
+local comp post ret=1 _compskip _prio_num=1 format _comp_ignore \
       context state line opt_args val_args curcontext="$curcontext" \
       _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel \
       _saved_exact="${compstate[exact]}" \
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 12d497a97..a76319030 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -55,11 +55,10 @@ while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:12n" opt; do
          ;;
   F)     tmp1="$OPTARG"
          if [[ "$tmp1[1]" = '(' ]]; then
-           ignore=( ${^=tmp1[2,-2]}/ )
+           ignore=( ${=tmp1[2,-2]} )
          else
-           ignore=( ${(P)${tmp1}} )
+           ignore=( ${(P)tmp1} )
          fi
-	 (( $#ignore )) && ignore=(-F "( $ignore )")
          ;;
   [JV])  group=("-$opt" "$OPTARG")
          ;;
@@ -158,18 +157,13 @@ eorig="$orig"
    ( $#compstate[pattern_match] -ne 0 &&
      "${orig#\~}" != "${${orig#\~}:q}" ) ]] && menu=yes
 
-# If given no `-F' option, we want to use the `ignored-suffixes'-style.
+# If given no `-F' option, we may want to use $fignore, turned into patterns.
 
-if [[ $#ignore -eq 0 && -z $gopt ]]; then
-  if zstyle -a ":completion${curcontext}:files" ignored-suffixes ignore; then
-    ignore=(-F "( $ignore )")
-  else
-
-    # For now we still use the fignore parameter.
-    # This may be removed some day.
+[[ $#ignore -eq 0 && -z $gopt ]] && ignore=( "?*${^fignore[@]}" )
 
-    ignore=(-F fignore)
-  fi
+if (( $#ignore )); then
+  _comp_ignore=( "$_comp_ignore[@]" "$ignore[@]" )
+  (( $expl[(I)-F] )) || expl=( "$expl[@]" -F _comp_ignore )
 fi
 
 # Now let's have a closer look at the string to complete.
@@ -298,11 +292,11 @@ for prepath in "$prepaths[@]"; do
     if [[ -n "$PREFIX$SUFFIX" ]]; then
       # See which of them match what's on the line.
 
-      builtin compadd -D tmp1 "$ignore[@]" "$matcher[@]" - "${(@)tmp1:t}"
+      builtin compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp1:t}"
 
       if [[ $#tmp1 -eq 0 && -n "$_comp_correct" ]]; then
         tmp1=( "$tmp2[@]" )
-	compadd -D tmp1 "$ignore[@]" "$matcher[@]" - "${(@)tmp2:t}"
+	compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp2:t}"
       fi
 
       # If no file matches, save the expanded path and continue with
@@ -423,13 +417,13 @@ for prepath in "$prepaths[@]"; do
             compstate[to_end]=''
         if [[ "$tmp3" = */* ]]; then
 	  compadd -Qf "$mopts[@]" -p "$linepath$tmp4" -s "/${tmp3#*/}" \
-	          -W "$prepath$realpath$testpath" "$ignore[@]" \
+	          -W "$prepath$realpath$testpath" \
 		  "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
                   -M "r:|/=* r:|=* $mspec" "$group[@]" "$expl[@]" \
 		  - "${(@)tmp1%%/*}"
 	else
 	  compadd -Qf "$mopts[@]" -p "$linepath$tmp4" \
-	          -W "$prepath$realpath$testpath" "$ignore[@]" \
+	          -W "$prepath$realpath$testpath" \
 		   "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
                    -M "r:|/=* r:|=* $mspec" "$group[@]" "$expl[@]" \
 		   - "$tmp1[@]"
@@ -437,7 +431,7 @@ for prepath in "$prepaths[@]"; do
       else
         if [[ "$tmp3" = */* ]]; then
 	  atmp=( -Qf "$mopts[@]" -p "$linepath$tmp4"
-	         -W "$prepath$realpath$testpath" "$ignore[@]"
+	         -W "$prepath$realpath$testpath"
 	         "$addpfx[@]" "$addsfx[@]" "$remsfx[@]"
                  -M "r:|/=* r:|=* $mspec" "$group[@]" "$expl[@]" )
           for i in "$tmp1[@]"; do
@@ -445,7 +439,7 @@ for prepath in "$prepaths[@]"; do
 	  done
         else
 	  compadd -Qf "$mopts[@]" -p "$linepath$tmp4" \
-		  -W "$prepath$realpath$testpath" "$ignore[@]" \
+		  -W "$prepath$realpath$testpath" \
 		  "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
                   -M "r:|/=* r:|=* $mspec" "$group[@]" "$expl[@]" \
 		  - "$tmp1[@]"
@@ -495,7 +489,7 @@ for prepath in "$prepaths[@]"; do
     tmp4="$testpath"
     compquote tmp4 tmp1
     compadd -Qf "$mopts[@]" -p "$linepath$tmp4" \
-	    -W "$prepath$realpath$testpath" "$ignore[@]" \
+	    -W "$prepath$realpath$testpath" \
 	    "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
             -M "r:|/=* r:|=* $mspec" "$group[@]" "$expl[@]" \
 	    - "$tmp1[@]"