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

Re: _command_names and path



> Probably changing _command_names to use `_files -P/ -W/ ...' if `.' is
> not in $path.

Index: Completion/Zsh/Type/_command_names
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_command_names,v
retrieving revision 1.3
diff -u -r1.3 _command_names
--- Completion/Zsh/Type/_command_names	2001/06/21 09:33:16	1.3
+++ Completion/Zsh/Type/_command_names	2002/01/27 20:42:15
@@ -8,8 +8,17 @@
 
 defs=(
   'commands:external command:compadd -k commands'
-  'executables:executable file or directory:_path_files -/g \*\(-\*\)'
 )
+
+if [[ -n "$path[(r).]" ]]; then
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_path_files -/g \*\(-\*\)'
+  )
+else
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)'
+  )
+fi
 
 if [[ "$1" = -e ]]; then
   shift



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