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

PATCH: example functions



Trying to reduce Pater's workload I've put several things together:

- Mainly, this changes the tags for the example code to `#compdef [-k|-p]',
  making them look more like command lines.
- It add a completion function for the `stat' builtin (from the `stat' 
  module.)
- It should fix the problem reported by Andrej in 5966 -- that was a
  piece of code implemented when we didn't have the code that skips
  over existing path-prefixes (trying to avoid having `./foo' complete 
  to `.frob/foo').
- It fixes another problem in `_path_files' for something which I
  consider a bug in the globbing code. The pattern `/lib/m*/' results
  in `/lib/modules/', but the pattern `/lib/(#l)m*/' gives a `no
  match' error. The interesting bit is the trailing slash.

Due to the first one this touches most of the example files.

Bye
 Sven

diff -u -r ooc/Base/_brace_parameter Completion/Base/_brace_parameter
--- ooc/Base/_brace_parameter	Mon Mar 29 10:27:30 1999
+++ Completion/Base/_brace_parameter	Mon Mar 29 10:50:52 1999
@@ -1,4 +1,4 @@
-#defcomp -brace-parameter-
+#compdef -brace-parameter-
 
 if [[ "$SUFFIX" = *\}* ]]; then
   ISUFFIX="${SUFFIX#*\}}$ISUFFIX"
diff -u -r ooc/Base/_command_names Completion/Base/_command_names
--- ooc/Base/_command_names	Mon Mar 29 10:27:29 1999
+++ Completion/Base/_command_names	Mon Mar 29 10:50:52 1999
@@ -1,4 +1,4 @@
-#defcomp -command-
+#compdef -command-
 
 local nm=$compstate[nmatches] ret=1
 
diff -u -r ooc/Base/_condition Completion/Base/_condition
--- ooc/Base/_condition	Mon Mar 29 10:27:29 1999
+++ Completion/Base/_condition	Mon Mar 29 10:50:52 1999
@@ -1,4 +1,4 @@
-#defcomp -condition-
+#compdef -condition-
 
 local prev="$words[CURRENT-1]"
 
diff -u -r ooc/Base/_default Completion/Base/_default
--- ooc/Base/_default	Mon Mar 29 10:27:29 1999
+++ Completion/Base/_default	Mon Mar 29 10:50:52 1999
@@ -1,4 +1,4 @@
-#defcomp -default-
+#compdef -default-
 
 # We first try the `compctl's. This is without first (-T) and default (-D)
 # completion. If you want them add `-T' and/or `-D' to this command.
diff -u -r ooc/Base/_equal Completion/Base/_equal
--- ooc/Base/_equal	Mon Mar 29 10:27:30 1999
+++ Completion/Base/_equal	Mon Mar 29 10:50:53 1999
@@ -1,3 +1,3 @@
-#defcomp -equal-
+#compdef -equal-
 
 compgen -am
diff -u -r ooc/Base/_math Completion/Base/_math
--- ooc/Base/_math	Mon Mar 29 10:27:30 1999
+++ Completion/Base/_math	Mon Mar 29 10:50:53 1999
@@ -1,4 +1,4 @@
-#defcomp -math-
+#compdef -math-
 
 if [[ "$PREFIX" = *[^a-zA-Z0-9_]* ]]; then
   IPREFIX="$IPREFIX${PREFIX%%[a-zA-Z0-9_]#}"
@@ -10,7 +10,7 @@
 fi
 
 compgen -v
-#defcomp -math-
+#compdef -math-
 
 IPREFIX="$IPREFIX${PREFIX%[a-zA-Z0-9_]*}"
 PREFIX="${PREFIX##*[^a-zA-Z0-9_]}"
diff -u -r ooc/Base/_parameter Completion/Base/_parameter
--- ooc/Base/_parameter	Mon Mar 29 10:27:30 1999
+++ Completion/Base/_parameter	Mon Mar 29 10:50:53 1999
@@ -1,3 +1,3 @@
-#defcomp -parameter-
+#compdef -parameter-
 
 compgen -v
diff -u -r ooc/Base/_precommand Completion/Base/_precommand
--- ooc/Base/_precommand	Mon Mar 29 10:27:29 1999
+++ Completion/Base/_precommand	Mon Mar 29 10:50:53 1999
@@ -1,4 +1,4 @@
-#defcomp - nohup nice eval time rusage noglob nocorrect exec
+#compdef - nohup nice eval time rusage noglob nocorrect exec
 
 shift words
 (( CURRENT-- ))
diff -u -r ooc/Base/_redirect Completion/Base/_redirect
--- ooc/Base/_redirect	Mon Mar 29 10:27:29 1999
+++ Completion/Base/_redirect	Mon Mar 29 10:50:53 1999
@@ -1,3 +1,3 @@
-#defcomp -redirect-
+#compdef -redirect-
 
 _files
diff -u -r ooc/Base/_subscript Completion/Base/_subscript
--- ooc/Base/_subscript	Mon Mar 29 10:27:29 1999
+++ Completion/Base/_subscript	Mon Mar 29 10:50:54 1999
@@ -1,4 +1,4 @@
-#defcomp -subscript-
+#compdef -subscript-
 
 if [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then
   compgen -S ']' -k "( ${(kP)${compstate[parameter]}} )"
diff -u -r ooc/Base/_tilde Completion/Base/_tilde
--- ooc/Base/_tilde	Mon Mar 29 10:27:30 1999
+++ Completion/Base/_tilde	Mon Mar 29 10:50:54 1999
@@ -1,4 +1,4 @@
-#defcomp -tilde-
+#compdef -tilde-
 
 # We use all named directories and user names here. If this is too slow
 # for you or if there are too many of them, you may want to use
diff -u -r ooc/Base/_vars Completion/Base/_vars
--- ooc/Base/_vars	Mon Mar 29 10:27:29 1999
+++ Completion/Base/_vars	Mon Mar 29 10:50:54 1999
@@ -1,3 +1,3 @@
-#defcomp getopts read unset vared
+#compdef getopts read unset vared
 
 compgen -v
diff -u -r ooc/Builtins/_aliases Completion/Builtins/_aliases
--- ooc/Builtins/_aliases	Mon Mar 29 10:27:30 1999
+++ Completion/Builtins/_aliases	Mon Mar 29 10:50:54 1999
@@ -1,3 +1,3 @@
-#defcomp unalias
+#compdef unalias
 
 compgen -a
diff -u -r ooc/Builtins/_arrays Completion/Builtins/_arrays
--- ooc/Builtins/_arrays	Mon Mar 29 10:27:30 1999
+++ Completion/Builtins/_arrays	Mon Mar 29 10:50:54 1999
@@ -1,3 +1,3 @@
-#defcomp shift
+#compdef shift
 
 compgen -A
diff -u -r ooc/Builtins/_autoload Completion/Builtins/_autoload
--- ooc/Builtins/_autoload	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_autoload	Mon Mar 29 10:50:54 1999
@@ -1,3 +1,3 @@
-#defcomp autoload
+#compdef autoload
 
 compgen -s '${^fpath}/*(N:t)'
diff -u -r ooc/Builtins/_bg_jobs Completion/Builtins/_bg_jobs
--- ooc/Builtins/_bg_jobs	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_bg_jobs	Mon Mar 29 10:50:55 1999
@@ -1,3 +1,3 @@
-#defcomp bg
+#compdef bg
 
 compgen -z -P '%'
diff -u -r ooc/Builtins/_bindkey Completion/Builtins/_bindkey
--- ooc/Builtins/_bindkey	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_bindkey	Mon Mar 29 10:50:55 1999
@@ -1,4 +1,4 @@
-#defcomp bindkey
+#compdef bindkey
 
 # Normally, this completes names of zle widgets, whether the builtin ones
 # or ones defined by the user.  Note that a - allows a wildcard before it,
diff -u -r ooc/Builtins/_builtin Completion/Builtins/_builtin
--- ooc/Builtins/_builtin	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_builtin	Mon Mar 29 10:50:55 1999
@@ -1,4 +1,4 @@
-#defcomp builtin
+#compdef builtin
 
 if (( $CURRENT > 2 )); then
   shift words
diff -u -r ooc/Builtins/_cd Completion/Builtins/_cd
--- ooc/Builtins/_cd	Mon Mar 29 10:27:30 1999
+++ Completion/Builtins/_cd	Mon Mar 29 10:50:55 1999
@@ -1,4 +1,4 @@
-#defcomp cd pushd
+#compdef cd pushd
 
 # Handling of cd.
 #  - Normally just completes directories.  Uses cdpath if that's set
diff -u -r ooc/Builtins/_command Completion/Builtins/_command
--- ooc/Builtins/_command	Mon Mar 29 10:27:30 1999
+++ Completion/Builtins/_command	Mon Mar 29 10:50:55 1999
@@ -1,4 +1,4 @@
-#defcomp command
+#compdef command
 
 if [[ CURRENT -ge 3 ]]; then
   compset -n 2
diff -u -r ooc/Builtins/_dirs Completion/Builtins/_dirs
--- ooc/Builtins/_dirs	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_dirs	Mon Mar 29 10:50:56 1999
@@ -1,3 +1,3 @@
-#defcomp rmdir df du dircmp
+#compdef rmdir df du dircmp
 
 _files -/
diff -u -r ooc/Builtins/_disable Completion/Builtins/_disable
--- ooc/Builtins/_disable	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_disable	Mon Mar 29 10:50:56 1999
@@ -1,4 +1,4 @@
-#defcomp disable
+#compdef disable
 
 local prev="$words[CURRENT-1]" ret=1
 
diff -u -r ooc/Builtins/_echotc Completion/Builtins/_echotc
--- ooc/Builtins/_echotc	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_echotc	Mon Mar 29 10:50:56 1999
@@ -1,3 +1,3 @@
-#defcomp echotc
+#compdef echotc
 
 compgen -k '(al dc dl do le up al bl cd ce cl cr dc dl do ho is le ma nd nl se so up)'
diff -u -r ooc/Builtins/_enable Completion/Builtins/_enable
--- ooc/Builtins/_enable	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_enable	Mon Mar 29 10:50:56 1999
@@ -1,4 +1,4 @@
-#defcomp enable
+#compdef enable
 
 local prev="$words[CURRENT-1]" ret=1
 
diff -u -r ooc/Builtins/_fc Completion/Builtins/_fc
--- ooc/Builtins/_fc	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_fc	Mon Mar 29 10:50:56 1999
@@ -1,4 +1,4 @@
-#defcomp fc
+#compdef fc
 
 local prev="$words[CURRENT-1]"
 
diff -u -r ooc/Builtins/_functions Completion/Builtins/_functions
--- ooc/Builtins/_functions	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_functions	Mon Mar 29 10:50:57 1999
@@ -1,3 +1,3 @@
-#defcomp unfunction
+#compdef unfunction
 
 compgen -F
diff -u -r ooc/Builtins/_hash Completion/Builtins/_hash
--- ooc/Builtins/_hash	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_hash	Mon Mar 29 10:50:57 1999
@@ -1,4 +1,4 @@
-#defcomp hash
+#compdef hash
 
 if [[ "$words[2]" = -*d* ]]; then
   if compset -P 1 '*\='; then
diff -u -r ooc/Builtins/_jobs Completion/Builtins/_jobs
--- ooc/Builtins/_jobs	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_jobs	Mon Mar 29 10:50:57 1999
@@ -1,3 +1,3 @@
-#defcomp fg jobs
+#compdef fg jobs
 
 compgen -j -P '%'
diff -u -r ooc/Builtins/_kill Completion/Builtins/_kill
--- ooc/Builtins/_kill	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_kill	Mon Mar 29 10:50:57 1999
@@ -1,4 +1,4 @@
-#defcomp kill
+#compdef kill
 
 local list
 
diff -u -r ooc/Builtins/_limits Completion/Builtins/_limits
--- ooc/Builtins/_limits	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_limits	Mon Mar 29 10:50:58 1999
@@ -1,3 +1,3 @@
-#defcomp limit unlimit
+#compdef limit unlimit
 
 compgen -k "(${(j: :)${(f)$(limit)}%% *})"
diff -u -r ooc/Builtins/_sched Completion/Builtins/_sched
--- ooc/Builtins/_sched	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_sched	Mon Mar 29 10:50:58 1999
@@ -1,3 +1,3 @@
-#defcomp sched
+#compdef sched
 
 compset -n 3 && _normal
diff -u -r ooc/Builtins/_set Completion/Builtins/_set
--- ooc/Builtins/_set	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_set	Mon Mar 29 10:50:58 1999
@@ -1,4 +1,4 @@
-#defcomp set
+#compdef set
 
 local prev="$words[CURRENT-1]"
 
diff -u -r ooc/Builtins/_setopt Completion/Builtins/_setopt
--- ooc/Builtins/_setopt	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_setopt	Mon Mar 29 10:50:58 1999
@@ -1,4 +1,4 @@
-#defcomp setopt
+#compdef setopt
 
 # If you first want to complete only unset options, un-comment the lines
 # setting the _unset_options  array and then use:
diff -u -r ooc/Builtins/_source Completion/Builtins/_source
--- ooc/Builtins/_source	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_source	Mon Mar 29 10:50:58 1999
@@ -1,4 +1,4 @@
-#defcomp source
+#compdef source
 
 if [[ CURRENT -ge 3 ]]; then
   compset -n 2
diff -u -r Completion/Builtins/_stat Completion/Builtins/_stat
--- Completion/Builtins/_stat	Mon Mar 29 10:55:30 1999
+++ Completion/Builtins/_stat	Mon Mar 29 10:50:59 1999
@@ -0,0 +1,10 @@
+#compdef stat
+
+if [[ "$words[CURRENT-1]" = -[AH] ]]; then
+  compgen -A
+else
+  [[ "$PREFIX[1]" = + ]] &&
+      compadd - +device +inode +mode +nlink +uid +gid +rdev +size \
+                +atime +mtime +ctime +blksize +block +link
+  _files
+fi
diff -u -r ooc/Builtins/_trap Completion/Builtins/_trap
--- ooc/Builtins/_trap	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_trap	Mon Mar 29 10:50:59 1999
@@ -1,4 +1,4 @@
-#defcomp trap
+#compdef trap
 
 if [[ CURRENT -eq 2 ]]; then
   compgen -c
diff -u -r ooc/Builtins/_unhash Completion/Builtins/_unhash
--- ooc/Builtins/_unhash	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_unhash	Mon Mar 29 10:50:59 1999
@@ -1,4 +1,4 @@
-#defcomp unhash
+#compdef unhash
 
 local fl="$words[2]" ret=1
 
diff -u -r ooc/Builtins/_unsetopt Completion/Builtins/_unsetopt
--- ooc/Builtins/_unsetopt	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_unsetopt	Mon Mar 29 10:50:59 1999
@@ -1,4 +1,4 @@
-#defcomp unsetopt
+#compdef unsetopt
 
 # If you first want to complete only unset options, uncomment the lines
 # setting the _set_options  array and then use:
diff -u -r ooc/Builtins/_vars_eq Completion/Builtins/_vars_eq
--- ooc/Builtins/_vars_eq	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_vars_eq	Mon Mar 29 10:50:59 1999
@@ -1,3 +1,3 @@
-#defcomp declare export integer local readonly typeset
+#compdef declare export integer local readonly typeset
 
 compgen -v -q -S '='
diff -u -r ooc/Builtins/_wait Completion/Builtins/_wait
--- ooc/Builtins/_wait	Mon Mar 29 10:27:31 1999
+++ Completion/Builtins/_wait	Mon Mar 29 10:51:00 1999
@@ -1,4 +1,4 @@
-#defcomp wait
+#compdef wait
 
 local list ret=1
 
diff -u -r ooc/Builtins/_which Completion/Builtins/_which
--- ooc/Builtins/_which	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_which	Mon Mar 29 10:51:00 1999
@@ -1,3 +1,3 @@
-#defcomp which whence where type
+#compdef which whence where type
 
 compgen -caF
diff -u -r ooc/Builtins/_zftp Completion/Builtins/_zftp
--- ooc/Builtins/_zftp	Mon Mar 29 10:27:30 1999
+++ Completion/Builtins/_zftp	Mon Mar 29 10:51:00 1999
@@ -1,4 +1,4 @@
-#defpatcomp zf*
+#compdef -p zf*
 
 # Don't try any more completion after this.
 _compskip=1
diff -u -r ooc/Builtins/_zle Completion/Builtins/_zle
--- ooc/Builtins/_zle	Mon Mar 29 10:27:30 1999
+++ Completion/Builtins/_zle	Mon Mar 29 10:51:00 1999
@@ -1,4 +1,4 @@
-#defcomp zle
+#compdef zle
 
 if [[ "$words[2]" = -N && CURRENT -eq 3 ]]; then
   compgen -F
diff -u -r ooc/Builtins/_zmodload Completion/Builtins/_zmodload
--- ooc/Builtins/_zmodload	Mon Mar 29 10:27:32 1999
+++ Completion/Builtins/_zmodload	Mon Mar 29 10:51:00 1999
@@ -1,4 +1,4 @@
-#defcomp zmodload
+#compdef zmodload
 
 local fl="$words[2]"
 
diff -u -r ooc/Commands/_correct_filename Completion/Commands/_correct_filename
--- ooc/Commands/_correct_filename	Mon Mar 29 10:27:32 1999
+++ Completion/Commands/_correct_filename	Mon Mar 29 10:51:01 1999
@@ -1,4 +1,4 @@
-#defkeycomp complete-word \C-xC
+#compdef -k complete-word \C-xc
 
 # Function to correct a filename.  Can be used as a completion widget,
 # or as a function in its own right, in which case it will print the
diff -u -r ooc/Commands/_correct_word Completion/Commands/_correct_word
--- ooc/Commands/_correct_word	Mon Mar 29 10:27:32 1999
+++ Completion/Commands/_correct_word	Mon Mar 29 10:51:29 1999
@@ -1,4 +1,4 @@
-#defkeycomp complete-word \C-xc
+#compdef -k complete-word \C-xc
 
 # Simple completion front-end implementing spelling correction.
 # The maximum number of errors is set quite high, and
diff -u -r ooc/Commands/_most_recent_file Completion/Commands/_most_recent_file
--- ooc/Commands/_most_recent_file	Mon Mar 29 10:27:32 1999
+++ Completion/Commands/_most_recent_file	Mon Mar 29 10:51:01 1999
@@ -1,4 +1,4 @@
-#defkeycomp complete-word \C-xm
+#compdef -k complete-word \C-xm
 
 # Complete the most recent file matching the pattern on the line so
 # far: globbing is active, i.e. *.txt will be expanded to the most recent
diff -u -r ooc/Core/_path_files Completion/Core/_path_files
--- ooc/Core/_path_files	Mon Mar 29 10:27:33 1999
+++ Completion/Core/_path_files	Mon Mar 29 10:53:03 1999
@@ -7,10 +7,9 @@
 # the last have the same syntax and meaning as for `compgen' or
 # `compadd', respectively. The `-F <ignore>' option may be used to give
 # a list of suffixes either by giving the name of an array or
-# literally by giving them in a string surrounded by
-# parentheses. Files with one of the suffixes thus given are treated
-# like files with one of the suffixes in the `fignore' array in normal
-# completion.
+# literally by giving them in a string surrounded by parentheses. Files
+# with one of the suffixes thus given are treated like files with one
+# of the suffixes in the `fignore' array in normal completion.
 #
 # This function supports one configuration key:
 #
@@ -215,7 +214,7 @@
 # have special meaning for globbing, we remove them. But before that, we
 # add the pattern for matching any characters before a slash.
 
-patstr="$patstr:gs-/-*/-:gs/*.*./../:gs/**/*/:gs-.*/-./-"
+patstr="$patstr:gs-/-*/-:gs/*.*./../:gs/**/*/"
 
 # We take the last pathname component from the pattern and store it in
 # `patlast', replacing `*'s in it with patterns that match any character
@@ -326,14 +325,15 @@
       # next `-W' path.
 
       if [[ $#collect -eq 0 ]]; then
-        # Before giving, we first try to get the longest expandable path-
+        # Before giving up, we first try to get the longest expandable path-
 	# prefix, though. The result is stored in `exppaths'
 
         tmp2=()
 	tmp3="$rest"
+	[[ "$tmp3[-1]" = / ]] && tmp3="$tmp3[1,-2](-/M)"
 	tmp4="${ostr##*/}"
 	ostr="${ostr%/*}"
-	while [[ "$tmp3" = */* ]]; do
+	while [[ "$ostr" = */* ]]; do
 	  tmp2=( ${^tmp1}/${~mflags}${~tmp3} )
 	  if [[ $#tmp2 -eq 1 ]]; then
 	    exppaths=( "$exppaths[@]" "${tmp2[1]}${tmp4}" )
diff -u -r ooc/Core/compinit Completion/Core/compinit
--- ooc/Core/compinit	Mon Mar 29 10:27:33 1999
+++ Completion/Core/compinit	Mon Mar 29 10:51:01 1999
@@ -1,25 +1,23 @@
 # Initialisation for new style completion. This mainly contains some helper
-# function and aliases. Everything else is split into different files in this
-# directory that will automatically be made autoloaded (see the end of this
-# file).
+# functions and aliases. Everything else is split into different files that
+# will automatically be made autoloaded (see the end of this file).
 # The names of the files that will be considered for autoloading have to
-# start with a underscores (like `_setopt).
+# start with an underscores (like `_setopt).
 # The first line of these files will be read and has to say what should be
 # done with its contents:
 #
-#   `#defcomp <names ...>'
-#     if the first line looks like this, the file is
-#     autoloaded as a function and that function will
-#     be called to generate the matches when completing
-#     for one of the commands whose <name> is given
-#
-#   `#defpatcomp <pattern>'
-#     this defines a function that should be called to generate
-#     matches for commands whose name matches <pattern>; note
-#     that only one pattern may be given
+#   `#compdef <names ...>'
+#     If the first line looks like this, the file is autoloaded as a
+#     function and that function will be called to generate the matches
+#     when completing for one of the commands whose <names> are given.
+#
+#   `#compdef -p <pattern>'
+#     This defines a function that should be called to generate matches
+#     for commands whose name matches <pattern>. Note that only one pattern
+#     may be given.
 #
-#   `#defkeycomp <style> [ <key-sequence> ... ]
-#     this is used to bind special completions to all the given
+#   `#compdef -k <style> [ <key-sequence> ... ]
+#     This is used to bind special completions to all the given
 #     <key-sequence>(s). The <style> is the name of one of the built-in
 #     completion widgets (complete-word, delete-char-or-list,
 #     expand-or-complete, expand-or-complete-prefix, list-choices,
@@ -262,12 +260,12 @@
       read -rA _i_line < $_i_file
       _i_tag=$_i_line[1]
       shift _i_line
-      if [[ $_i_tag = '#defcomp' ]]; then
-        compdef -na "${_i_file:t}" "${_i_line[@]}"
-      elif [[ $_i_tag = '#defpatcomp' ]]; then
-        compdef -pa "${_i_file:t}" "${_i_line[@]}"
-      elif [[ $_i_tag = '#defkeycomp' ]]; then
-        compdef -ka "${_i_file:t}" "${_i_line[@]}"
+      if [[ $_i_tag = '#compdef' ]]; then
+        case $_i_line[2] in
+	-p) compdef -pa "${_i_file:t}" "${_i_line[@]}";;
+	-k) compdef -ka "${_i_file:t}" "${_i_line[@]}";;
+	*)  compdef -na "${_i_file:t}" "${_i_line[@]}";;
+	esac
       elif [[ $_i_tag = '#autoload' ]]; then
 	autoload ${_i_file:t}
       fi
diff -u -r ooc/User/_a2ps Completion/User/_a2ps
--- ooc/User/_a2ps	Mon Mar 29 10:27:34 1999
+++ Completion/User/_a2ps	Mon Mar 29 10:51:01 1999
@@ -1,4 +1,4 @@
-#defcomp a2ps
+#compdef a2ps
 
 # This is for the GNU version of a2ps.
 
diff -u -r ooc/User/_compress Completion/User/_compress
--- ooc/User/_compress	Mon Mar 29 10:27:34 1999
+++ Completion/User/_compress	Mon Mar 29 10:51:01 1999
@@ -1,3 +1,3 @@
-#defcomp compress
+#compdef compress
 
 _files -g '*~*.Z'
diff -u -r ooc/User/_configure Completion/User/_configure
--- ooc/User/_configure	Mon Mar 29 10:27:34 1999
+++ Completion/User/_configure	Mon Mar 29 10:51:02 1999
@@ -1,4 +1,4 @@
-#defcomp configure
+#compdef configure
 
 _long_options '*=(E|)PREFIX*' '_files -/' \
               '*=PROGRAM*'    '_command_names'
diff -u -r ooc/User/_dd Completion/User/_dd
--- ooc/User/_dd	Mon Mar 29 10:27:34 1999
+++ Completion/User/_dd	Mon Mar 29 10:51:02 1999
@@ -1,4 +1,4 @@
-#defcomp dd
+#compdef dd
 
 if compset -P 1 'conv\='; then
   # If there's a comma present, ignore up to the last one.  The
diff -u -r ooc/User/_dvi Completion/User/_dvi
--- ooc/User/_dvi	Mon Mar 29 10:27:35 1999
+++ Completion/User/_dvi	Mon Mar 29 10:51:02 1999
@@ -1,3 +1,3 @@
-#defcomp xdvi dvips dvibook dviconcat dvicopy dvidvi dviselect dvitodvi dvitype
+#compdef xdvi dvips dvibook dviconcat dvicopy dvidvi dviselect dvitodvi dvitype
 
 _files -g '*.(dvi|DVI)'
diff -u -r ooc/User/_find Completion/User/_find
--- ooc/User/_find	Mon Mar 29 10:27:34 1999
+++ Completion/User/_find	Mon Mar 29 10:51:02 1999
@@ -1,4 +1,4 @@
-#defcomp find
+#compdef find
 
 local prev="$words[CURRENT-1]"
 
diff -u -r ooc/User/_gunzip Completion/User/_gunzip
--- ooc/User/_gunzip	Mon Mar 29 10:27:34 1999
+++ Completion/User/_gunzip	Mon Mar 29 10:51:02 1999
@@ -1,3 +1,3 @@
-#defcomp gunzip zcat
+#compdef gunzip zcat
 
 _files -g '*.[gG][z]'
diff -u -r ooc/User/_gzip Completion/User/_gzip
--- ooc/User/_gzip	Mon Mar 29 10:27:34 1999
+++ Completion/User/_gzip	Mon Mar 29 10:51:03 1999
@@ -1,3 +1,3 @@
-#defcomp gzip
+#compdef gzip
 
 _files -g '*~*.[gG][zZ]'
diff -u -r ooc/User/_hosts Completion/User/_hosts
--- ooc/User/_hosts	Mon Mar 29 10:27:35 1999
+++ Completion/User/_hosts	Mon Mar 29 10:51:03 1999
@@ -1,3 +1,3 @@
-#defcomp ftp ncftp ping rwho rup xping traceroute nslookup
+#compdef ftp ncftp ping rwho rup xping traceroute nslookup
 
 compgen -k hosts
diff -u -r ooc/User/_make Completion/User/_make
--- ooc/User/_make	Mon Mar 29 10:27:34 1999
+++ Completion/User/_make	Mon Mar 29 10:51:03 1999
@@ -1,3 +1,3 @@
-#defcomp make gmake pmake
+#compdef make gmake pmake
 
 compgen -s "\$(awk '/^[a-zA-Z0-9][^\/         ]+:/ {print \$1}' FS=: [mM]akefile)"
diff -u -r ooc/User/_man Completion/User/_man
--- ooc/User/_man	Mon Mar 29 10:27:34 1999
+++ Completion/User/_man	Mon Mar 29 10:51:03 1999
@@ -1,4 +1,4 @@
-#defcomp man
+#compdef man
 
 setopt localoptions rcexpandparam
 
diff -u -r ooc/User/_mh Completion/User/_mh
--- ooc/User/_mh	Mon Mar 29 10:27:35 1999
+++ Completion/User/_mh	Mon Mar 29 10:51:03 1999
@@ -1,4 +1,4 @@
-#defcomp folder folders comp inc mark refile repl scan show next prev rmm pick whom mhn mhpath
+#compdef folder folders comp inc mark refile repl scan show next prev rmm pick whom mhn mhpath
 
 # Completion for all possible MH commands.
 # Alter the following two to your own mh directory and the directory
diff -u -r ooc/User/_pdf Completion/User/_pdf
--- ooc/User/_pdf	Mon Mar 29 10:27:35 1999
+++ Completion/User/_pdf	Mon Mar 29 10:51:04 1999
@@ -1,3 +1,3 @@
-#defcomp acroread
+#compdef acroread
 
 _files -g '*.(pdf|PDF)'
diff -u -r ooc/User/_ps Completion/User/_ps
--- ooc/User/_ps	Mon Mar 29 10:27:35 1999
+++ Completion/User/_ps	Mon Mar 29 10:51:04 1999
@@ -1,3 +1,3 @@
-#defcomp  gs ghostview gview psnup psselect pswrap pstops pstruct lpr
+#compdef  gs ghostview gview psnup psselect pswrap pstops pstruct lpr
 
 _files -g '*([pP][sS]|eps)'
diff -u -r ooc/User/_rcs Completion/User/_rcs
--- ooc/User/_rcs	Mon Mar 29 10:27:35 1999
+++ Completion/User/_rcs	Mon Mar 29 10:51:04 1999
@@ -1,4 +1,4 @@
-#defcomp co ci rcs
+#compdef co ci rcs
 
 local nm=$compstate[nmatches]
 
diff -u -r ooc/User/_rlogin Completion/User/_rlogin
--- ooc/User/_rlogin	Mon Mar 29 10:27:35 1999
+++ Completion/User/_rlogin	Mon Mar 29 10:51:04 1999
@@ -1,4 +1,4 @@
-#defcomp rlogin rsh ssh
+#compdef rlogin rsh ssh
 
 if [[ CURRENT -eq 2 ]]; then
   compgen -k hosts
diff -u -r ooc/User/_strip Completion/User/_strip
--- ooc/User/_strip	Mon Mar 29 10:27:35 1999
+++ Completion/User/_strip	Mon Mar 29 10:51:04 1999
@@ -1,3 +1,3 @@
-#defcomp strip
+#compdef strip
 
 _files -g '*(*)'
diff -u -r ooc/User/_stty Completion/User/_stty
--- ooc/User/_stty	Mon Mar 29 10:27:35 1999
+++ Completion/User/_stty	Mon Mar 29 10:51:05 1999
@@ -1,4 +1,4 @@
-#defcomp stty
+#compdef stty
 
 if [[ "$words[CURRENT-1]" = \
   (*erase|discard|status|dsusp|intr|kill|lnext|quit|reprint|start|s*p) ]]
diff -u -r ooc/User/_tar Completion/User/_tar
--- ooc/User/_tar	Mon Mar 29 10:27:35 1999
+++ Completion/User/_tar	Mon Mar 29 10:51:05 1999
@@ -1,4 +1,4 @@
-#defcomp tar
+#compdef tar
 
 # Tar completion.  Features:
 #  - Tries to collect tar commands from second position, single letter
diff -u -r ooc/User/_tex Completion/User/_tex
--- ooc/User/_tex	Mon Mar 29 10:27:35 1999
+++ Completion/User/_tex	Mon Mar 29 10:51:05 1999
@@ -1,3 +1,3 @@
-#defcomp tex latex slitex
+#compdef tex latex slitex
 
 _files -g '*.(tex|TEX|texinfo|texi)'
diff -u -r ooc/User/_uncompress Completion/User/_uncompress
--- ooc/User/_uncompress	Mon Mar 29 10:27:35 1999
+++ Completion/User/_uncompress	Mon Mar 29 10:51:05 1999
@@ -1,3 +1,3 @@
-#defcomp uncompress zmore
+#compdef uncompress zmore
 
 _files -g '*.Z'
diff -u -r ooc/User/_x_options Completion/User/_x_options
--- ooc/User/_x_options	Mon Mar 29 10:27:35 1999
+++ Completion/User/_x_options	Mon Mar 29 10:51:05 1999
@@ -1,4 +1,4 @@
-#defpatcomp */X11/*
+#compdef -p */X11/*
 
 # A simple pattern completion, just as an example.
 
diff -u -r ooc/User/_xfig Completion/User/_xfig
--- ooc/User/_xfig	Mon Mar 29 10:27:35 1999
+++ Completion/User/_xfig	Mon Mar 29 10:51:06 1999
@@ -1,3 +1,3 @@
-#defcomp xfig
+#compdef xfig
 
 _files -g '*.fig'

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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