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

PATCH: labels, not aliases



Here is the patch to replace calls to `_try' with `_next_label' and
`_loop' with `_all_labels'.

This also means, that everyone should

  mv Completion/Core/_{try,next_label}
  mv Completion/Core/_{loop,all_labels}

And this time I remembered to change .distfiles. Sigh.

Bye
 Sven

diff -ru ../z.old/Completion/Base/_arguments Completion/Base/_arguments
--- ../z.old/Completion/Base/_arguments	Wed Mar 29 10:15:46 2000
+++ Completion/Base/_arguments	Wed Mar 29 10:19:29 2000
@@ -230,13 +230,13 @@
 
             # Anything inside `(...)' is added directly.
 
-            _loop arguments expl "$descr" \
+            _all_labels arguments expl "$descr" \
                 compadd "$subopts[@]" - ${=action[2,-2]}
           elif [[ "$action" = \{*\} ]]; then
 
             # A string in braces is evaluated.
 
-            while _try arguments expl "$descr"; do
+            while _next_label arguments expl "$descr"; do
               eval "$action[2,-2]"
             done
           elif [[ "$action" = \ * ]]; then
@@ -244,7 +244,7 @@
             # If the action starts with a space, we just call it.
 
 	    eval "action=( $action )"
-            while _try arguments expl "$descr"; do
+            while _next_label arguments expl "$descr"; do
               "$action[@]"
             done
           else
@@ -252,7 +252,7 @@
             # Otherwise we call it with the description-arguments.
 
             eval "action=( $action )"
-            _loop arguments expl "$descr" \
+            _all_labels arguments expl "$descr" \
                 "$action[1]" "$subopts[@]" "${(@)action[2,-1]}"
           fi
         fi
diff -ru ../z.old/Completion/Base/_describe Completion/Base/_describe
--- ../z.old/Completion/Base/_describe	Wed Mar 29 10:15:46 2000
+++ Completion/Base/_describe	Wed Mar 29 10:19:29 2000
@@ -24,7 +24,7 @@
 [[ "$_type" = options ]] &&
     zstyle -t ":completion:${curcontext}:options" prefix-hidden && _hide=yes
 
-while _try "$_type" _expl "$_descr"; do
+while _next_label "$_type" _expl "$_descr"; do
 
   if [[ -n "$_showd" ]]; then
     compdescribe -I ' -- ' "$@"
diff -ru ../z.old/Completion/Base/_jobs Completion/Base/_jobs
--- ../z.old/Completion/Base/_jobs	Wed Mar 29 10:15:47 2000
+++ Completion/Base/_jobs	Wed Mar 29 10:19:29 2000
@@ -79,7 +79,7 @@
 fi
 
 if [[ -n "$desc" ]]; then
-  _loop jobs expl "$expls" compadd "$@" -ld disp - "%$^jobs[@]"
+  _all_labels jobs expl "$expls" compadd "$@" -ld disp - "%$^jobs[@]"
 else
-  _loop jobs expl "$expls" compadd "$@" - "%$^jobs[@]"
+  _all_labels jobs expl "$expls" compadd "$@" - "%$^jobs[@]"
 fi
diff -ru ../z.old/Completion/Base/_subscript Completion/Base/_subscript
--- ../z.old/Completion/Base/_subscript	Wed Mar 29 10:15:47 2000
+++ Completion/Base/_subscript	Wed Mar 29 10:19:29 2000
@@ -38,10 +38,10 @@
       fi
 
       if [[ "$RBUFFER" = \]* ]]; then
-        _loop -V indexes expl 'array index' \
+        _all_labels -V indexes expl 'array index' \
             compadd -S '' "$disp[@]" - "$ind[@]" && ret=0
       else
-        _loop -V indexes expl 'array index' \
+        _all_labels -V indexes expl 'array index' \
             compadd -S ']' "$disp[@]" - "$ind[@]" && ret=0
       fi
     fi
diff -ru ../z.old/Completion/Base/_tilde Completion/Base/_tilde
--- ../z.old/Completion/Base/_tilde	Wed Mar 29 10:15:47 2000
+++ Completion/Base/_tilde	Wed Mar 29 10:19:29 2000
@@ -46,7 +46,7 @@
       list=( ${PREFIX[1]}{0..${#dirstack}} )
       disp=()
     fi
-    _loop -V directory-stack expl 'directory stack' \
+    _all_labels -V directory-stack expl 'directory stack' \
         compadd "$suf[@]" "$disp[@]" -Q - "$list[@]" && ret=0
   fi
   (( ret )) || return 0
diff -ru ../z.old/Completion/Base/_values Completion/Base/_values
--- ../z.old/Completion/Base/_values	Wed Mar 29 10:15:48 2000
+++ Completion/Base/_values	Wed Mar 29 10:19:30 2000
@@ -119,12 +119,13 @@
 
       # Anything inside `(...)' is added directly.
 
-      _loop arguments expl "$descr" compadd "$subopts[@]" - ${=action[2,-2]}
+      _all_labels arguments expl "$descr" \
+          compadd "$subopts[@]" - ${=action[2,-2]}
     elif [[ "$action" = \{*\} ]]; then
 
       # A string in braces is evaluated.
 
-      while _try arguments expl "$descr"; do
+      while _next_label arguments expl "$descr"; do
         eval "$action[2,-2]"
       done
     elif [[ "$action" = \ * ]]; then
@@ -132,7 +133,7 @@
       # If the action starts with a space, we just call it.
 
       eval "action=( $action )"
-      while _try arguments expl "$descr"; do
+      while _next_label arguments expl "$descr"; do
         "$action[@]"
       done
     else
@@ -140,7 +141,7 @@
       # Otherwise we call it with the description-arguments built above.
 
       eval "action=( $action )"
-      _loop arguments expl "$descr" \
+      _all_labels arguments expl "$descr" \
           "$action[1]" "$subopts[@]" "${(@)action[2,-1]}"
     fi
   fi
diff -ru ../z.old/Completion/Builtins/_compdef Completion/Builtins/_compdef
--- ../z.old/Completion/Builtins/_compdef	Wed Mar 29 10:15:49 2000
+++ Completion/Builtins/_compdef	Wed Mar 29 10:19:30 2000
@@ -23,9 +23,10 @@
       list=( ${^fpath:/.}/_(|*[^~])(N:t) )
       if zstyle -T ":completion:${curcontext}:functions" prefix-hidden; then
         disp=( ${list[@]#_} )
-        _loop functions expl 'completion function' compadd -d disp - "$list[@]"
+        _all_labels functions expl 'completion function' \
+            compadd -d disp - "$list[@]"
       else
-        _loop functions expl 'completion function' compadd - "$list[@]"
+        _all_labels functions expl 'completion function' compadd - "$list[@]"
       fi
     fi
   ;;
diff -ru ../z.old/Completion/Builtins/_pids Completion/Builtins/_pids
--- ../z.old/Completion/Builtins/_pids	Wed Mar 29 10:15:50 2000
+++ Completion/Builtins/_pids	Wed Mar 29 10:19:30 2000
@@ -29,6 +29,6 @@
   desc=()
 fi
 
-_loop processes expl 'process ID' \
+_all_labels processes expl 'process ID' \
     compadd "$@" "$desc[@]" - \
         ${${${(M)${(f)"${out}"}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]#*${~match}}## #}%% *}
diff -ru ../z.old/Completion/Builtins/_popd Completion/Builtins/_popd
--- ../z.old/Completion/Builtins/_popd	Wed Mar 29 10:15:51 2000
+++ Completion/Builtins/_popd	Wed Mar 29 10:19:30 2000
@@ -39,5 +39,5 @@
   disp=()
 fi
 
-_loop -V directory-stack expl 'directory stack' \
+_all_labels -V directory-stack expl 'directory stack' \
     compadd "$@" "$disp[@]" -Q - "$list[@]"
diff -ru ../z.old/Completion/Builtins/_sched Completion/Builtins/_sched
--- ../z.old/Completion/Builtins/_sched	Wed Mar 29 10:15:51 2000
+++ Completion/Builtins/_sched	Wed Mar 29 10:19:30 2000
@@ -12,7 +12,7 @@
     else
       disp=()
     fi
-    [[ -z $lines ]] || _loop jobs expl 'scheduled jobs' \
+    [[ -z $lines ]] || _all_labels jobs expl 'scheduled jobs' \
                            compadd "$disp[@]" - {1..$#lines}
     return
   else
diff -ru ../z.old/Completion/Builtins/_signals Completion/Builtins/_signals
--- ../z.old/Completion/Builtins/_signals	Wed Mar 29 10:15:51 2000
+++ Completion/Builtins/_signals	Wed Mar 29 10:19:31 2000
@@ -32,7 +32,7 @@
   else
     disp=()
   fi
-  _loop signals expl signal \
+  _all_labels signals expl signal \
       compadd "$@" "$disp[@]" -M 'm:{a-z}={A-Z}' - \
               "${minus}${(@)^signals[1,last]}"
 fi
diff -ru ../z.old/Completion/Builtins/_stat Completion/Builtins/_stat
--- ../z.old/Completion/Builtins/_stat	Wed Mar 29 10:15:51 2000
+++ Completion/Builtins/_stat	Wed Mar 29 10:19:31 2000
@@ -12,7 +12,7 @@
     _requested options &&
         { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
           [[ "$PREFIX[1]" = + || ret -eq 1 ]] } &&
-        _loop options expl 'inode element' \
+        _all_labels options expl 'inode element' \
             compadd - +device +inode +mode +nlink +uid +gid +rdev \
                       +size +atime +mtime +ctime +blksize +block +link
     (( ret )) || return 0
diff -ru ../z.old/Completion/Builtins/_zftp Completion/Builtins/_zftp
--- ../z.old/Completion/Builtins/_zftp	Wed Mar 29 10:15:52 2000
+++ Completion/Builtins/_zftp	Wed Mar 29 10:19:31 2000
@@ -51,12 +51,12 @@
     _wanted bookmarks || return 1
     if [[ $words[2] = -*n* ]]; then
       if [[ -f ~/.ncftp/bookmarks ]]; then
-        _loop bookmarks expl bookmark \
+        _all_labels bookmarks expl bookmark \
             compadd - $(awk -F, 'NR > 2 { print $1 }' ~/.ncftp/bookmarks)
       fi
     else
       if [[ -f ${ZFTP_BMFILE:=${ZDOTDIR:-$HOME}/.zfbkmarks} ]]; then
-        _loop bookmarks expl bookmark \
+        _all_labels bookmarks expl bookmark \
             compadd - $(awk '{print $1}' $ZFTP_BMFILE)
       fi
     fi
diff -ru ../z.old/Completion/Builtins/_zpty Completion/Builtins/_zpty
--- ../z.old/Completion/Builtins/_zpty	Wed Mar 29 10:15:52 2000
+++ Completion/Builtins/_zpty	Wed Mar 29 10:19:31 2000
@@ -16,8 +16,8 @@
   names=( ${list%%:*} )
   if zstyle -T ":completion:${curcontext}" verbose; then
     zformat -a list ' --' ${${(f)"$(zpty)"}#*\) }
-    _loop names expl 'zpty command names' compadd -d list - "$names[@]"
+    _all_labels names expl 'zpty command names' compadd -d list - "$names[@]"
   else
-    _loop names expl 'zpty command names' compadd - "$names[@]"
+    _all_labels names expl 'zpty command names' compadd - "$names[@]"
   fi
 fi
diff -ru ../z.old/Completion/Builtins/_zstyle Completion/Builtins/_zstyle
--- ../z.old/Completion/Builtins/_zstyle	Wed Mar 29 10:15:52 2000
+++ Completion/Builtins/_zstyle	Wed Mar 29 10:31:17 2000
@@ -95,7 +95,7 @@
     contexts)
       if _wanted contexts; then
         if [[ $PREFIX != :*: ]]; then
-	  _loop contexts expl context compadd -P : -S : completion zftp
+	  _all_labels contexts expl context compadd -P : -S : completion zftp
         elif [[ $PREFIX = :completion:* ]]; then
           mesg=''
           case "$PREFIX" in
diff -ru ../z.old/Completion/Core/.distfiles Completion/Core/.distfiles
--- ../z.old/Completion/Core/.distfiles	Wed Mar 29 10:15:59 2000
+++ Completion/Core/.distfiles	Wed Mar 29 10:28:30 2000
@@ -1,10 +1,9 @@
 DISTFILES_SRC='
     .distfiles
-    _alternative _approximate _call _compalso _complete _correct _description
-    _expand _files _funcall _list _main_complete _match
-    _menu _multi_parts _message _normal _oldlist _options
-    _parameters _path_files _prefix _requested _sep_parts
-    _set_options _setup _sort_tags _tags
-    _unset_options _wanted
+    _all_labels _alternative _approximate _call _compalso _complete
+    _correct _description _expand _files _funcall _list _main_complete
+    _match _menu _multi_parts _message _next_label _normal _oldlist
+    _options _parameters _path_files _prefix _requested _sep_parts
+    _set_options _setup _sort_tags _tags _unset_options _wanted
     compdump compinit compinstall
 '
diff -ru ../z.old/Completion/Core/_alternative Completion/Core/_alternative
--- ../z.old/Completion/Core/_alternative	Wed Mar 29 10:15:55 2000
+++ Completion/Core/_alternative	Wed Mar 29 10:19:31 2000
@@ -44,13 +44,13 @@
 
         # Anything inside `(...)' is added directly.
 
-        _loop "${def%%:*}" expl "$descr" \
+        _all_labels "${def%%:*}" expl "$descr" \
             compadd "$subopts[@]" - ${=action[2,-2]}
       elif [[ "$action" = \{*\} ]]; then
 
         # A string in braces is evaluated.
 
-        while _try "${def%%:*}" expl "$descr"; do
+        while _next_label "${def%%:*}" expl "$descr"; do
           eval "$action[2,-2]"
         done
       elif [[ "$action" = \ * ]]; then
@@ -58,7 +58,7 @@
         # If the action starts with a space, we just call it.
 
         eval "action=( $action )"
-        while _try "${def%%:*}" expl "$descr"; do
+        while _next_label "${def%%:*}" expl "$descr"; do
           "$action[@]"
         done
       else
@@ -66,7 +66,7 @@
         # Otherwise we call it with the description-arguments built above.
 
         eval "action=( $action )"
-        _loop "${def%%:*}" expl "$descr" \
+        _all_labels "${def%%:*}" expl "$descr" \
             "$action[1]" "$subopts[@]" "${(@)action[2,-1]}"
       fi
     fi
diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files
--- ../z.old/Completion/Core/_path_files	Wed Mar 29 10:15:57 2000
+++ Completion/Core/_path_files	Wed Mar 29 10:19:38 2000
@@ -528,13 +528,10 @@
 # them as possible matches.
 
 if zstyle -t ":completion:${curcontext}:paths" expand prefix &&
-   [[ nm -eq compstate[nmatches] ]]; then
-
-  if (( $#exppaths )); then
-    PREFIX="${opre}"
-    SUFFIX="${osuf}"
-    compadd -Q "$mopts[@]" -S '' -M "r:|/=* r:|=*" -p "$linepath" - "$exppaths[@]"
-  fi
+   [[ nm -eq compstate[nmatches] && $#exppaths -ne 0 ]]; then
+  PREFIX="${opre}"
+  SUFFIX="${osuf}"
+  compadd -Q "$mopts[@]" -S '' -M "r:|/=* r:|=*" -p "$linepath" - "$exppaths[@]"
 fi
 
 [[ nm -ne compstate[nmatches] ]]
diff -ru ../z.old/Completion/Core/_requested Completion/Core/_requested
--- ../z.old/Completion/Core/_requested	Wed Mar 29 10:15:57 2000
+++ Completion/Core/_requested	Wed Mar 29 10:19:31 2000
@@ -10,7 +10,7 @@
 if comptags -R "$1"; then
   _comp_tags="$_comp_tags $1"
   if [[ $# -gt 3 ]]; then
-    _loop "$gopt" "$@"
+    _all_labels "$gopt" "$@"
   elif [[ $# -gt 1 ]]; then
     _description "$gopt" "$@"
   fi
diff -ru ../z.old/Completion/Core/_wanted Completion/Core/_wanted
--- ../z.old/Completion/Core/_wanted	Wed Mar 29 10:15:58 2000
+++ Completion/Core/_wanted	Wed Mar 29 10:19:32 2000
@@ -21,7 +21,7 @@
   if _tags "$targs[@]" "$1"; then
     _comp_tags="$_comp_tags $1"
 
-    _loop -t "$gopt" "$@"
+    _all_labels -t "$gopt" "$@"
   else
     return 1
   fi
diff -ru ../z.old/Completion/User/_gdb Completion/User/_gdb
--- ../z.old/Completion/User/_gdb	Wed Mar 29 10:16:03 2000
+++ Completion/User/_gdb	Wed Mar 29 10:19:32 2000
@@ -18,7 +18,7 @@
   _files
 elif [[ "$PREFIX" = -* ]]; then
   if _wanted options; then
-    while _try options expl option; do
+    while _next_label options expl option; do
       compadd "$expl[@]" -QS '' - -symbols\= -exec\= -se\= -core\= -command\= \
                                   -directory\= -cd\= -tty\= && ret=0
       compadd "$expl[@]"        - -help -h -s -e -c -x -d -nx -n -quiet -q \
diff -ru ../z.old/Completion/User/_getconf Completion/User/_getconf
--- ../z.old/Completion/User/_getconf	Wed Mar 29 10:16:02 2000
+++ Completion/User/_getconf	Wed Mar 29 10:19:32 2000
@@ -24,7 +24,7 @@
 	  POSIX2_SW_DEV _XOPEN_VERSION && ret=0
 
     _requested pathconfig &&
-        while _try -V pathconfig expl 'system path configuration variables'; do
+        while _next_label -V pathconfig expl 'system path configuration variables'; do
           compadd "$expl[@]" -S '' PIPE_BUF _POSIX_CHOWN_RESTRICTED \
                                    _POSIX_NO_TRUNC _POSIX_VDISABLE && ret=0
           compadd "$expl[@]" -S ' ' LINK_MAX MAX_CANON MAX_INPUT NAME_MAX \
diff -ru ../z.old/Completion/User/_groups Completion/User/_groups
--- ../z.old/Completion/User/_groups	Wed Mar 29 10:16:04 2000
+++ Completion/User/_groups	Wed Mar 29 10:19:32 2000
@@ -16,4 +16,4 @@
   groups=( "$_cache_groups[@]" )
 fi
 
-_loop groups expl group compadd "$@" - "$groups[@]"
+_all_labels groups expl group compadd "$@" - "$groups[@]"
diff -ru ../z.old/Completion/User/_lp Completion/User/_lp
--- ../z.old/Completion/User/_lp	Wed Mar 29 10:16:04 2000
+++ Completion/User/_lp	Wed Mar 29 10:19:32 2000
@@ -43,7 +43,7 @@
     else
       disp=()
     fi
-    _loop printers expl printer \
+    _all_labels printers expl printer \
         compadd "$disp[@]" - "${(@)_lp_cache%%:*}" && return 0
 
     (( $+_lp_alias_cache )) || return 1
@@ -80,7 +80,7 @@
           else
   	  disp=()
           fi
-	  _loop users expl user compadd "$disp[@]" - "$strs[@]" ||
+	  _all_labels users expl user compadd "$disp[@]" - "$strs[@]" ||
               _users && ret=0
         fi
         if _requested jobs; then
@@ -92,7 +92,7 @@
           else
   	  disp=()
           fi
-          _loop jobs expl job compadd "$disp[@]" - "$strs[@]" && ret=0
+          _all_labels jobs expl job compadd "$disp[@]" - "$strs[@]" && ret=0
         fi
         (( ret )) || return 0
       done
diff -ru ../z.old/Completion/User/_make Completion/User/_make
--- ../z.old/Completion/User/_make	Wed Mar 29 10:16:04 2000
+++ Completion/User/_make	Wed Mar 29 10:19:33 2000
@@ -25,7 +25,7 @@
  	        print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \
  	     FS=: $file)
          )
-    _loop targets expl 'make target' compadd "$tmp[@]" && return 0
+    _all_labels targets expl 'make target' compadd "$tmp[@]" && return 0
   fi
   compset -P 1 '*='
   _files
diff -ru ../z.old/Completion/User/_mh Completion/User/_mh
--- ../z.old/Completion/User/_mh	Wed Mar 29 10:16:05 2000
+++ Completion/User/_mh	Wed Mar 29 10:19:33 2000
@@ -18,7 +18,7 @@
   # awk is just too icky to use for this, sorry.  send me one if
   # you come up with it.
   if _wanted options; then
-    _loop options expl option \
+    _all_labels options expl option \
         compadd - $($words[1] -help | perl -ne 'if (/^\s*-\(?(\S+)/) {
             $n = $1;
             $n =~ s/\)//g;
@@ -73,7 +73,7 @@
   fi
 
   if _wanted sequences; then
-    while _try sequences expl sequence; do
+    while _next_label sequences expl sequence; do
       compadd "$expl[@]" $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') &&
         ret=0
       compadd "$expl[@]" reply next cur prev first last all unseen && ret=0
diff -ru ../z.old/Completion/User/_netscape Completion/User/_netscape
--- ../z.old/Completion/User/_netscape	Wed Mar 29 10:16:05 2000
+++ Completion/User/_netscape	Wed Mar 29 10:19:33 2000
@@ -58,11 +58,11 @@
     *)
       if _wanted commands; then
         if [[ -z "$QIPREFIX" ]]; then
-	  _loop commands expl 'remote commands' \
+	  _all_labels commands expl 'remote commands' \
   	      compadd  -s'(' -S '' -M 'm:{a-zA-Z}={A-Za-z}' - \
                       $remote_commands && ret=0
         else
-	  _loop commands expl 'remote commands' \
+	  _all_labels commands expl 'remote commands' \
               compadd -qS '(' -M 'm:{a-zA-Z}={A-Za-z}' - \
                       $remote_commands && ret=0
 	fi
@@ -79,7 +79,7 @@
             license logo memory-cache mozilla plugins && ret=0
   else
     if _wanted prefixes; then
-      while _try prefixes expl 'URL prefix'; do
+      while _next_label prefixes expl 'URL prefix'; do
         compadd "$expl[@]" -S '' about: mocha: javascript: && ret=0
         _urls "$@" && ret=0
 	(( ret )) || return 0
diff -ru ../z.old/Completion/User/_tiff Completion/User/_tiff
--- ../z.old/Completion/User/_tiff	Wed Mar 29 10:16:07 2000
+++ Completion/User/_tiff	Wed Mar 29 10:19:33 2000
@@ -196,7 +196,7 @@
     esac
   else
     if _wanted values; then
-      while _try values expl 'compression scheme'; do
+      while _next_label values expl 'compression scheme'; do
         compadd "$expl[@]" - none g4 packbits && ret=0
         compadd "$expl[@]" -qS: - lzw zip jpeg g3 && ret=0
 	(( ret )) || return 0
diff -ru ../z.old/Completion/User/_urls Completion/User/_urls
--- ../z.old/Completion/User/_urls	Wed Mar 29 10:16:07 2000
+++ Completion/User/_urls	Wed Mar 29 10:19:33 2000
@@ -55,7 +55,7 @@
 ipre="$IPREFIX"
 
 if ! compset -P '(#b)([-+.a-z0-9]#):' && _wanted -C argument prefixes; then
-  while _try prefixes expl 'URL prefix' "$@"; do
+  while _next_label prefixes expl 'URL prefix' "$@"; do
     [[ -d $urls_path/bookmark ]] &&
       compadd "$expl[@]" -S '' bookmark: && ret=0
     compadd "$expl[@]" -S '' file: ftp:// gopher:// http:// && ret=0
@@ -76,7 +76,7 @@
     if ! compset -P //; then
       _wanted -C file files || return 1
 
-      while _try files expl 'local file' "$@"; do
+      while _next_label files expl 'local file' "$@"; do
         if [[ -prefix / ]]; then
 	  _path_files "$expl[@]" -S '' -g '*(^/)' && ret=0
 	  _path_files "$expl[@]" -S/ -r '/' -/ && ret=0
@@ -96,7 +96,7 @@
               "$ipre$(<"$urls_path/$scheme/${(Q)PREFIX}${(Q)SUFFIX}")" && ret=0
     else
       if _wanted -C bookmark files; then
-        while _try files expl 'bookmark'; do
+        while _next_label files expl 'bookmark'; do
           _path_files -W "$urls_path/$scheme" "$expl[@]" -S '' -g '*(^/)' && 
               ret=0
           _path_files -W "$urls_path/$scheme" -S/ -r '/' -/ && ret=0
@@ -112,7 +112,7 @@
 if ! compset -P '(#b)([^/]#)/' && _wanted hosts; then
   uhosts=($urls_path/$scheme/$PREFIX*$SUFFIX(/:t))
 
-  while _try hosts expl host "$@"; do
+  while _next_label hosts expl host "$@"; do
     (( $#uhosts )) || _hosts -S/ && ret=0
     [[ "$scheme" = http ]] && uhosts=($uhosts $localhttp_servername)
     compadd "$expl[@]" -S/ - $uhosts && ret=0
@@ -133,20 +133,20 @@
       return
     fi
     user="$match[1]"
-    while _try files expl 'local file'; do
+    while _next_label files expl 'local file'; do
       _path_files "$expl[@]" -W ~$user/$localhttp_userdir -g '*(^/)' && ret=0
       _path_files "$expl[@]" -W ~$user/$localhttp_userdir -S/ -r '/' -/ && ret=0
       (( ret )) || return 0
     done
   else
-    while _try files expl 'local file'; do
+    while _next_label files expl 'local file'; do
       _path_files "$expl[@]" -W $localhttp_documentroot -g '*(^/)' && ret=0
       _path_files "$expl[@]" -W $localhttp_documentroot -S/ -r '/' -/ && ret=0
       (( ret )) || return 0
     done
   fi
 else
-  while _try files expl 'local file'; do
+  while _next_label files expl 'local file'; do
     _path_files "$expl[@]" -W $urls_path/$scheme/$host -g '*(^/)' && ret=0
     _path_files "$expl[@]" -W $urls_path/$scheme/$host -S/ -r '/' -/ && ret=0
     (( ret )) || return 0
diff -ru ../z.old/Completion/User/_users Completion/User/_users
--- ../z.old/Completion/User/_users	Wed Mar 29 10:16:08 2000
+++ Completion/User/_users	Wed Mar 29 10:19:33 2000
@@ -5,6 +5,6 @@
 _wanted users || return 1
 
 zstyle -a ":completion:${curcontext}:" users users &&
-    _loop users expl user compadd "$@" - "$users[@]" && return 0
+    _all_labels users expl user compadd "$@" - "$users[@]" && return 0
 
-_loop users expl user compadd "$@" - "${(@k)userdirs}"
+_all_labels users expl user compadd "$@" - "${(@k)userdirs}"
diff -ru ../z.old/Completion/User/_users_on Completion/User/_users_on
--- ../z.old/Completion/User/_users_on	Wed Mar 29 10:16:08 2000
+++ Completion/User/_users_on	Wed Mar 29 10:19:34 2000
@@ -5,7 +5,7 @@
 _wanted users || return 1
 
 if which users >/dev/null; then
-  _loop users expl 'users logged on' \
+  _all_labels users expl 'users logged on' \
       compadd "$@" - $(_call users users) && return 0
 else
   # Other methods of finding out users logged on should be added here
diff -ru ../z.old/Completion/X/_x_colormapid Completion/X/_x_colormapid
--- ../z.old/Completion/X/_x_colormapid	Wed Mar 29 10:16:12 2000
+++ Completion/X/_x_colormapid	Wed Mar 29 10:19:34 2000
@@ -12,4 +12,5 @@
   desc=()
 fi
 
-_loop colormapids expl 'colormap id' compadd "$@" "$desc[@]" - "${(@)list%% *}" 
+_all_labels colormapids expl 'colormap id' \
+    compadd "$@" "$desc[@]" - "${(@)list%% *}" 
diff -ru ../z.old/Completion/X/_x_extension Completion/X/_x_extension
--- ../z.old/Completion/X/_x_extension	Wed Mar 29 10:16:10 2000
+++ Completion/X/_x_extension	Wed Mar 29 10:19:34 2000
@@ -9,11 +9,11 @@
 if [[ "$1" = -a ]]; then
   shift
 
-  _loop extensions expl 'X extensions' \
+  _all_labels extensions expl 'X extensions' \
       compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - all "$_xe_cache[@]"
 else
   [[ "$1" = - ]] && shift
 
-  _loop extensions expl 'X extensions' \
+  _all_labels extensions expl 'X extensions' \
       compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - "$_xe_cache[@]"
 fi
diff -ru ../z.old/Completion/X/_x_font Completion/X/_x_font
--- ../z.old/Completion/X/_x_font	Wed Mar 29 10:16:10 2000
+++ Completion/X/_x_font	Wed Mar 29 10:19:34 2000
@@ -12,4 +12,5 @@
  _font_cache=( "${(@)^${(@f)$(_call fonts xlsfonts)}%%--*}--" )
 fi
 
-_loop fonts expl font compadd -M 'r:|-=* r:|=*' "$@" -S '' - "$_font_cache[@]"
+_all_labels fonts expl font \
+    compadd -M 'r:|-=* r:|=*' "$@" -S '' - "$_font_cache[@]"
diff -ru ../z.old/Completion/X/_x_keysym Completion/X/_x_keysym
--- ../z.old/Completion/X/_x_keysym	Wed Mar 29 10:16:11 2000
+++ Completion/X/_x_keysym	Wed Mar 29 10:19:34 2000
@@ -18,5 +18,5 @@
   fi
 fi
 
-_loop keysyms expl 'key symbol' \
+_all_labels keysyms expl 'key symbol' \
     compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - $_keysym_cache
diff -ru ../z.old/Completion/X/_x_window Completion/X/_x_window
--- ../z.old/Completion/X/_x_window	Wed Mar 29 10:16:12 2000
+++ Completion/X/_x_window	Wed Mar 29 10:19:34 2000
@@ -9,10 +9,10 @@
 if [[ "$1" = -n ]]; then
   shift
 
-  _loop windows expl 'window name' \
+  _all_labels windows expl 'window name' \
       compadd "$@" -d list - "${(@)${(@)list#*\"}%%\"*}"
 else
   [[ "$1" = - ]] && shift
 
-  _loop windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}"
+  _all_labels windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}"
 fi
diff -ru ../z.old/Completion/X/_xmodmap Completion/X/_xmodmap
--- ../z.old/Completion/X/_xmodmap	Wed Mar 29 10:16:12 2000
+++ Completion/X/_xmodmap	Wed Mar 29 10:19:35 2000
@@ -83,7 +83,7 @@
 
   else
     if _wanted commands; then
-      while _try commands expl command; do
+      while _next_label commands expl command; do
         compadd "$expl[@]" -S ' ' keycode keysym clear add remove && ret=0
         compadd "$expl[@]" -S ' = ' pointer && ret=0
         (( ret )) || return 0
diff -ru ../z.old/Completion/X/_xutils Completion/X/_xutils
--- ../z.old/Completion/X/_xutils	Wed Mar 29 10:16:12 2000
+++ Completion/X/_xutils	Wed Mar 29 10:19:35 2000
@@ -56,7 +56,7 @@
       if compset -P '(#b)(*):'; then
 	type="$match[1]"
 	_wanted displays &&
-            while _try displays expl 'disallow access'; do
+            while _next_label displays expl 'disallow access'; do
 	      { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \
 		        ${${(M)tmp:#(#i)$type:*}#(#i)$type:} ||
 	            _hosts "$expl[@]" } && return 0
@@ -68,7 +68,7 @@
       fi
     else
       _wanted displays &&
-          while _try displays expl 'disallow access'; do
+          while _next_label displays expl 'disallow access'; do
 	    { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp ||
               _hosts "$expl[@]" } && return 0
           done
diff -ru ../z.old/Completion/X/_xwit Completion/X/_xwit
--- ../z.old/Completion/X/_xwit	Wed Mar 29 10:16:12 2000
+++ Completion/X/_xwit	Wed Mar 29 10:19:35 2000
@@ -17,7 +17,7 @@
 _xwit_compopts () {
   local expl
   _wanted options expl option compadd - ${(k)no[(R)*~0]} ||
-      _loop options expl option compadd - ${(k)no}
+      _all_labels options expl option compadd - ${(k)no}
 }
 
 _regex_arguments _xwit_parse \
diff -ru ../z.old/Doc/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- ../z.old/Doc/Zsh/compsys.yo	Wed Mar 29 10:15:30 2000
+++ Doc/Zsh/compsys.yo	Wed Mar 29 10:19:36 2000
@@ -1593,14 +1593,14 @@
 context.
 
 In strings not starting with an exclamation mark, it is also possible
-to specify tag aliases instead of only tags. These are of the form
-`var(tag)tt(:)var(alias)', where var(tag) is one of the tags offered
-by the completion function for the current context and var(alias) is a 
+to specify tag labels instead of only tags. These are of the form
+`var(tag)tt(:)var(label)', where var(tag) is one of the tags offered
+by the completion function for the current context and var(label) is a 
 name. For this, the completion function will generate matches in the
-same way as for the var(tag) but it will use the var(alias) in place
+same way as for the var(tag) but it will use the var(label) in place
 of the tag in the context names used to look up styles. If the
-var(alias) starts with a hyphen, the var(tag) is prepended to the
-var(alias) to form the name used for lookup. This can be
+var(label) starts with a hyphen, the var(tag) is prepended to the
+var(label) to form the name used for lookup. This can be
 used to make the completion system try a certain tag more than once,
 supplying different style settings for each attempt. For example,
 
@@ -1613,7 +1613,7 @@
 completed in command position is used, including the names of all
 shell functions.
 
-The var(alias) may optionally be followed by a second colon and a
+The var(label) may optionally be followed by a second colon and a
 description. This description will then be used for the `tt(%d)' in
 the value of the tt(format) style instead of the default description
 supplied by the completion function. Spaces in the description have to 
@@ -1636,7 +1636,7 @@
 zstyle ':completion:*:functions-non-comp' ignored-patterns '_*')
 
 Here, the completion system will first try all tags offered, but will
-use the tag alias tt(functions-non-comp) when looking up styles for
+use the tag label tt(functions-non-comp) when looking up styles for
 the function names completed. For this, the tt(ignored-patterns) style 
 is set to make functions starting with an underscore be not considered 
 as possible matches. If none of the generated matches match the string 
@@ -2353,44 +2353,44 @@
 specific context name without having to change and reset the
 tt(curcontext) parameter (which would otherwise have the same effect).
 )
-findex(_try)
-item(tt(_try) [ tt(-12VJ) ] var(tag) var(name) var(descr) [ var(options) ... ])(
+findex(_next_label)
+item(tt(_next_label) [ tt(-12VJ) ] var(tag) var(name) var(descr) [ var(options) ... ])(
 This function should be called repeatedly to generate the tag
-aliases. On each call it will check if another tag alias is to be used 
+labels. On each call it will check if another tag label is to be used 
 and, if there is at least one, zero is returned. If no more tag
-aliases are to be used, a non-zero status is returned.
+labels are to be used, a non-zero status is returned.
 
 The tt(-12JV) options and the first three arguments are given to the
-tt(_desciption) function using the alias tag instead of the first
+tt(_desciption) function using the tag label instead of the first
 argument is appropriate. The var(options) given after the var(descr)
 should be other options to be used for tt(compadd) or whatever
-function is to be called to add the matches. tt(_try) will store these 
+function is to be called to add the matches. tt(_next_label) will store these 
 var(options) in the parameter whose var(name) is given as the second
 argument. This is done in such a way that the description given by the 
 user to the tt(tag-order) style is prefered over the one given to
-tt(_try).
+tt(_next_label).
 
 Note that this function must not be called without a previous call to
-tt(_tags), tt(_wanted) or tt(_requested) because it uses the alias
-tags for the current tag found by these functions.
+tt(_tags), tt(_wanted) or tt(_requested) because it uses the tag label
+for the current tag found by these functions.
 
-A normal use of this function for the alias tags for the tag tt(foo)
+A normal use of this function for the tag labels for the tag tt(foo)
 looks like this:
 
 example(local expl ret=1
 ...
 _wanted foo || return 1
 ...
-while _try foo expl '...'; do
+while _next_label foo expl '...'; do
   compadd "$expl[@]" ... && ret=0
 done
 ...
 return ret
 )
 )
-findex(_loop)
-item(tt(_loop) [ tt(-12VJ) ] var(tag) var(name) var(descr) [ var(command) var(args) ... ])(
-This is a convenient interface to the tt(_try) function, implementing
+findex(_all_labels)
+item(tt(_all_labels) [ tt(-12VJ) ] var(tag) var(name) var(descr) [ var(command) var(args) ... ])(
+This is a convenient interface to the tt(_next_label) function, implementing
 the loop shown in the example above. The var(command) is the one that
 should be called to generate the matches. The options stored in the
 parameter var(name) will automatically be inserted into the var(args)
@@ -2398,7 +2398,7 @@
 var(command), but if one of the var(args) is a single hyphen, they are 
 inserted directly before that. If the hyphen is the last argument,
 that will be removed from the argument list before the var(command) is 
-called. This allows to use tt(_loop) in almost all cases where the
+called. This allows to use tt(_all_labels) in almost all cases where the
 matches can be generated by a single call to the tt(compadd) builtin
 command or by a call to one of the utility functions.
 
@@ -2408,11 +2408,11 @@
 ...
 _wanted foo || return 1
 ...
-_loop foo expl '...' compadd ... - $matches)
+_all_labels foo expl '...' compadd ... - $matches)
 
 Will complete the strings from the tt(matches) parameter, using
 tt(compadd) with additional options which will take precedence over
-those generated by tt(_loop).
+those generated by tt(_all_labels).
 )
 findex(_requested)
 item(tt(_requested) [ tt(-12VJ) ] var(tag) [ var(name) var(descr) [ var(command) var(args) ... ] ])(
@@ -2437,7 +2437,7 @@
 If the var(name) and the var(descr) are given, tt(_requested) calls the
 tt(_description) function with these arguments, including the options.
 
-If the var(command) is given, the tt(_loop) function will be called
+If the var(command) is given, the tt(_all_labels) function will be called
 immediatly with the same arguments.
 
 This is often useful to do both the testing of the tag,
@@ -2492,7 +2492,7 @@
 to offer usernames and hostnames as possible matches (which are
 generated by the tt(_users) and tt(_hosts) functions respectively).
 
-Note that, like tt(_arguments) this will also use tt(_loop) to execute 
+Note that, like tt(_arguments) this will also use tt(_all_labels) to execute 
 the actions, so one doesn't need to call that explicitly unless
 another tag is to be used, for example in a function called from
 tt(_alternative).
@@ -2526,8 +2526,8 @@
 descriptions should be shown. Without the `tt(-o)' option, only the
 tt(verbose) style is used.
 
-tt(_describe) uses the tt(_loop) function to generate the matches, so
-that one doesn't need to put it into a loop over the tag aliases.
+tt(_describe) uses the tt(_all_labels) function to generate the matches, so
+that one doesn't need to put it into a loop over the tag labels.
 )
 findex(_multi_parts)
 item(tt(_multi_parts) var(sep) var(array))(
@@ -2778,7 +2778,7 @@
 in an expansion like `tt($expl[@])').
 
 Except for the `tt(->)var(string)' form, the var(action) will be
-executed by calling the tt(_loop) function to process all tag aliases,
+executed by calling the tt(_all_labels) function to process all tag labels,
 so one doesn't need to call that explicitly unless another tag is to
 be used, for example in a function called in the var(action).
 
diff -ru ../z.old/Etc/completion-style-guide Etc/completion-style-guide
--- ../z.old/Etc/completion-style-guide	Wed Mar 29 10:15:36 2000
+++ Etc/completion-style-guide	Wed Mar 29 10:19:36 2000
@@ -68,30 +68,30 @@
 
   _wanted names || return 1
 
-  _loop names expl 'name' compadd - alice bob
+  _all_labels names expl 'name' compadd - alice bob
 
-The `_loop' function implements the loop over the tag aliases and
+The `_all_labels' function implements the loop over the tag aliases and
 handles the user-defined description, using (in the example) the
 parameter `expl' to store options to give to the command. These option 
 are inserted into the command line either directly before a single
 hyphen if there is such an argument or after the first word if there
-is no single hyphen. Since using `_loop' is so much more conveient
-than writing the loop with the `_try' function (see below), but some
-function called to generate matches don't accept a single hyphen as
-argument anywhere but want the options built as their last arguments,
-`_loop' will *replace* the hyphen with the options if the hyphen is
+is no single hyphen. Since using `_all_labels' is so much more conveient
+than writing the loop with the `_next_label' function (see below), but
+some function called to generate matches don't accept a single hyphen
+as argument anywhere but want the options built as their last arguments,
+`_all_labels' will *replace* the hyphen with the options if the hyphen is
 the last argument. A good example for such a function is
 `_combination' which can be called like:
 
-  _loop foo expl 'descr...' _combination ... -
+  _all_labels foo expl 'descr...' _combination ... -
 
 And the `-' will be replaced by the options that are to be given to
 `compadd'.
 
 Since the above sequence of command is used so often, the `_wanted'
-function can also accept the same arguments as `_loop'. In this case
-it will do the test for the requested tag and then just call `_loop',
-so:
+function can also accept the same arguments as `_all_labels'. In this
+case it will do the test for the requested tag and then just call
+`_all_labels', so:
 
   _wanted names expl 'name' compadd - alice bob
 
@@ -103,29 +103,29 @@
 In some cases one needs to call multiple functions or call `compadd'
 more than once to generate the matches. In such a case one needs to
 implement the loop over the tag aliases directly. This is done with the 
-`_try' function. Like this:
+`_next_label' function. Like this:
 
-  while _try names expl 'name'; do
+  while _next_label names expl 'name'; do
     compadd "$expl[@]" - alice bob && ret=0
     _other_names "$expl[@]" && ret=0
   done
   return ret
 
-Simple enough, I hope. But `_try' can do some more: utility functions
-normally accept options which are then given to `compadd'. Since these 
-may contain options for the description and `_try' may generate such
-options, too, it isn't entirely trivial to decide which of these
-options should take precedence. But `_try' can do the work for you
-here. All you have to do is to give the options your utility function
-gets to `_try', as in:
+Simple enough, I hope. But `_next_label' can do some more: utility
+functions normally accept options which are then given to `compadd'.
+Since these may contain options for the description and `_next_label' may
+generate such options, too, it isn't entirely trivial to decide which
+of these options should take precedence. But `_next_label' can do the work
+for you here. All you have to do is to give the options your utility
+function gets to `_next_label', as in:
 
-  while _try names expl 'name' "$@"; do
+  while _next_label names expl 'name' "$@"; do
     compadd "$expl[@]" - alice bob
     ...
   done
 
 That's all. Note that the positional argument "$@" are *not* given to
-`compadd'. They will be stuffed into the `expl' array by `_try'.
+`compadd'. They will be stuffed into the `expl' array by `_next_label'.
 
 The most complicated case is where you can offer multiple types of
 matches. In this case the user should be able to say which types he
diff -ru ../z.old/Functions/Zftp/zfcd_match Functions/Zftp/zfcd_match
--- ../z.old/Functions/Zftp/zfcd_match	Wed Mar 29 10:16:24 2000
+++ Functions/Zftp/zfcd_match	Wed Mar 29 10:30:03 2000
@@ -30,7 +30,8 @@
   rm -f $tmpf
   [[ -n $dir && $dir != */ ]] && dir="$dir/"
   if [[ -n $WIDGET ]]; then
-    _loop directories expl 'remote directory' compadd -S/ -q -P "$dir" - $reply
+    _all_labels directories expl 'remote directory'
+        compadd -S/ -q -P "$dir" - $reply
   elif [[ -n $dir ]]; then
     reply=(${dir}$reply)
   fi
diff -ru ../z.old/Functions/Zftp/zfget_match Functions/Zftp/zfget_match
--- ../z.old/Functions/Zftp/zfget_match	Wed Mar 29 10:16:24 2000
+++ Functions/Zftp/zfget_match	Wed Mar 29 10:29:46 2000
@@ -17,7 +17,7 @@
     local reply
     reply=(${${${(f)"$(<$tmpf)"}##$dir}%\*})
     rm -f $tmpf
-    _loop files expl 'remote file' compadd -P $dir - $reply
+    _all_labels files expl 'remote file' compadd -P $dir - $reply
   else
     # On the first argument to ls, we usually get away with a glob.
     zftp ls "$1*$2" >$tmpf
@@ -28,7 +28,7 @@
   local fcache_name
   zffcache
   if [[ -n $WIDGET ]]; then
-    _loop files expl 'remote file' compadd -F fignore - ${(P)fcache_name}
+    _all_labels files expl 'remote file' compadd -F fignore - ${(P)fcache_name}
   else
     reply=(${(P)fcache_name});
   fi

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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