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

PATCH: completion cleanup



Here is the result of the promised going-through-the-completion-functions.

There were indeed some more calls to _wanted with a "$expl[@]", not
only in _hash.

Bye
 Sven

Index: Completion/Base/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_arguments,v
retrieving revision 1.7
diff -u -r1.7 _arguments
--- Completion/Base/_arguments	2000/04/27 12:07:35	1.7
+++ Completion/Base/_arguments	2000/05/02 08:20:04
@@ -298,14 +298,15 @@
 	
         if comparguments -s single; then
 
-          _description options expl option
-
           if [[ "$single" = direct ]]; then
-	    compadd "$expl[@]" -QS '' - "${PREFIX}${SUFFIX}"
+            _all_labels options expl option \
+	        compadd -QS '' - "${PREFIX}${SUFFIX}"
           elif [[ "$single" = next ]]; then
-	    compadd "$expl[@]" -Q - "${PREFIX}${SUFFIX}"
+            _all_labels options expl option \
+	        compadd -Q - "${PREFIX}${SUFFIX}"
           elif [[ "$single" = equal ]]; then
-	    compadd "$expl[@]" -QqS= - "${PREFIX}${SUFFIX}"
+            _all_labels options expl option \
+	        compadd -QqS= - "${PREFIX}${SUFFIX}"
           else
 	    tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" )
 	    tmp3=( "${(M@)tmp1:#[-+]?[^:]*}" )
Index: Completion/Base/_first
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_first,v
retrieving revision 1.3
diff -u -r1.3 _first
--- Completion/Base/_first	2000/05/02 08:18:54	1.3
+++ Completion/Base/_first	2000/05/02 08:20:04
@@ -33,7 +33,7 @@
 #           opt=-V
 #         fi
 #         if _wanted "$opt" history-words expl "history ($n)" \
-#                compadd "$expl[@]" -Q - \
+#                compadd -Q - \
 #                    "${(@)${(@)historywords:#[\$'\"]*}[1,i*10]}"; then
 #           # We have found at least one matching word, so we switch
 #           # on menu-completion and make sure that no other
Index: Completion/Builtins/_hash
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_hash,v
retrieving revision 1.2
diff -u -r1.2 _hash
--- Completion/Builtins/_hash	2000/04/11 07:57:56	1.2
+++ Completion/Builtins/_hash	2000/05/02 08:20:04
@@ -10,7 +10,7 @@
         compadd -q -S '=' - "${(@k)nameddirs}"
   fi
 elif compset -P 1 '*='; then
-  _wanted -C value values expl 'executable file' _files "$expl[@]" -g '*(-*)'
+  _wanted -C value values expl 'executable file' _files -g '*(-*)'
 else
   _wanted -C name commands expl command compadd -q -S '=' - "${(@k)commands}"
 fi
Index: Completion/Core/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v
retrieving revision 1.5
diff -u -r1.5 _expand
--- Completion/Core/_expand	2000/05/01 18:14:08	1.5
+++ Completion/Core/_expand	2000/05/02 08:20:04
@@ -94,10 +94,8 @@
 else
   _tags all-expansions expansions original
 
-  if _requested all-expansions; then
-    _description all-expansions expl 'all expansions'
-    compadd "$expl[@]" -UQ -qS "$suf" - "$exp"
-  fi
+  _requested all-expansions expl 'all expansions' &&
+      compadd "$expl[@]" -UQ -qS "$suf" - "$exp"
 
   if [[ $#exp -gt 1 ]] && _requested expansions; then
     local i normal dir
Index: Completion/User/_gprof
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_gprof,v
retrieving revision 1.2
diff -u -r1.2 _gprof
--- Completion/User/_gprof	2000/04/11 07:57:57	1.2
+++ Completion/User/_gprof	2000/05/02 08:20:04
@@ -49,7 +49,7 @@
       expl=function
     fi
     _wanted functions expl "$expl" \
-        compadd "$expl[@]" -M 'r:|_=* r:|=*' - "$_gprof_funcs[@]" && ret=0
+        compadd -M 'r:|_=* r:|=*' - "$_gprof_funcs[@]" && ret=0
   else
     return 1
   fi
Index: Completion/User/_mount
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_mount,v
retrieving revision 1.3
diff -u -r1.3 _mount
--- Completion/User/_mount	2000/04/11 07:57:57	1.3
+++ Completion/User/_mount	2000/05/02 08:20:05
@@ -540,7 +540,7 @@
   compset -P '*,'
 
   _wanted types expl 'file system type' \
-      compadd "$expl[@]" -qS, -M 'L:|no=' - "$fss[@]" && ret=0
+      compadd -qS, -M 'L:|no=' - "$fss[@]" && ret=0
   ;;
 fsopt)
   _tags options || return 1
Index: Completion/User/_socket
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_socket,v
retrieving revision 1.2
diff -u -r1.2 _socket
--- Completion/User/_socket	2000/04/11 07:57:57	1.2
+++ Completion/User/_socket	2000/05/02 08:20:05
@@ -11,8 +11,7 @@
 [[ $CURRENT -eq 2 ]] &&
     { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
       [[ "$PREFIX" = -* ]] } &&
-    _wanted options expl option \
-        compadd -M 'r:|[_-]=* r:|=*' "$expl[@]" - -version
+    _wanted options expl option compadd - -version
 
 _arguments -C -s \
   '-b[background]' \
Index: Completion/User/_urls
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_urls,v
retrieving revision 1.5
diff -u -r1.5 _urls
--- Completion/User/_urls	2000/04/27 09:24:38	1.5
+++ Completion/User/_urls	2000/05/02 08:20:05
@@ -104,7 +104,7 @@
         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
+          _path_files -W "$urls_path/$scheme" "$expl[@]" -S/ -r '/' -/ && ret=0
         done
 	(( ret )) || return 0
       done

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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