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

PATCH: ignored-suffixes style



This adds the `ignored-suffixes' style which can be used to replace
the `fignore' array (that one is still used but maybe we will remove
it someday).

Then there was a typo in `_telnet' and `_arguments' didn't set
`curcontext' correctly for `-C'.

Bye
 Sven

diff -u -r oldcompletion/Base/_arguments Completion/Base/_arguments
--- oldcompletion/Base/_arguments	Mon Nov 22 11:40:02 1999
+++ Completion/Base/_arguments	Mon Nov 22 14:13:01 1999
@@ -199,7 +199,7 @@
           comparguments -W line opt_args
           state="${${action[3,-1]##[ 	]#}%%[ 	]#}"
 	  if [[ -n "$usecc" ]]; then
-	    curcontext="$subc"
+	    curcontext="${oldcontext}:$subc"
 	  else
 	    context="$subc"
 	  fi
diff -u -r oldcompletion/Core/_path_files Completion/Core/_path_files
--- oldcompletion/Core/_path_files	Mon Nov 22 11:40:09 1999
+++ Completion/Core/_path_files	Mon Nov 22 14:20:13 1999
@@ -110,9 +110,19 @@
    ( $#compstate[pattern_match] -ne 0 &&
      "${orig#\~}" != "${${orig#\~}:q}" ) ]] && menu=yes
 
-# If given no `-F' option, we want to use `fignore'.
+# If given no `-F' option, we want to use the `ignored-suffixes'-style.
 
-(( $#ignore )) || ignore=(-F fignore)
+if (( ! $#ignore )); then
+  if _style -a files ignored-suffixes ignore; then
+    ignore=(-F "( $ignore )")
+  else
+
+    # For now we still use the fignore parameter.
+    # This may be removed some day.
+
+    ignore=(-F fignore)
+  fi
+fi
 
 # Now let's have a closer look at the string to complete.
 
diff -u -r oldcompletion/User/_telnet Completion/User/_telnet
--- oldcompletion/User/_telnet	Mon Nov 22 11:40:15 1999
+++ Completion/User/_telnet	Mon Nov 22 14:13:32 1999
@@ -73,7 +73,7 @@
   _wanted ports expl port &&
       _combination '' hosts-ports-users \
           ${opt_args[-l]:+users=${opt_args[-l]:q}} \
-          hosts="${line[2]:q}" \
+          hosts="${line[1]:q}" \
           ports "$expl[@]"
   ;;
 
diff -u olddoc/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- olddoc/Zsh/compsys.yo	Mon Nov 22 11:39:27 1999
+++ Doc/Zsh/compsys.yo	Mon Nov 22 14:26:30 1999
@@ -867,7 +867,12 @@
 )
 item(tt(hosts-ports-users))(
 Like tt(hosts-ports) but used for commands like tt(telnet) and
-containing strings of the form `var(host)tt(:)var(port)tt(:)var(user)' .
+containing strings of the form `var(host)tt(:)var(port)tt(:)var(user)'.
+)
+item(tt(ignored-suffixes))(
+This style is used with the tt(files) tag and gives suffixes of
+filenames to ignore. The matches ignored will only be completed when
+there are no other matches.
 )
 item(tt(insert-unambiguous))(
 This is used by the tt(_match) completer function. If it is set to

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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