summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Builtins/_fc2
-rw-r--r--Completion/Builtins/_hash2
-rw-r--r--Completion/Builtins/_source15
-rw-r--r--Completion/Builtins/_which2
-rw-r--r--Completion/Builtins/_zftp4
-rw-r--r--Completion/User/_man2
-rw-r--r--Completion/User/_nedit2
8 files changed, 24 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 859c9e5cf..c479944ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2001-02-26  Sven Wischnowsky  <wischnow@zsh.org>
 
+	* 13534: Completion/Builtins/_fc, Completion/Builtins/_hash,
+ 	Completion/Builtins/_source, Completion/Builtins/_which,
+ 	Completion/Builtins/_zftp, Completion/User/_man,
+ 	Completion/User/_nedit: change $words[1] to $service in some more
+ 	places
+	
 	* 13530: Src/hist.c: properly restore noaliases in bufferwords()
 	
 2001-02-20  Sven Wischnowsky  <wischnow@zsh.org>
diff --git a/Completion/Builtins/_fc b/Completion/Builtins/_fc
index e97492604..cb3efe48f 100644
--- a/Completion/Builtins/_fc
+++ b/Completion/Builtins/_fc
@@ -13,7 +13,7 @@ fc_common=( \
   '(-A -R -W -I -e)-D[print elapsed times]' \
   '(-A -R -W -I)*::commands:_command_names -e' )
 
-if [[ $words[1] = *history ]]; then
+if [[ $service = *history ]]; then
   _arguments -C -s "$fc_common[@]"
 else
   _arguments -C -s \
diff --git a/Completion/Builtins/_hash b/Completion/Builtins/_hash
index 250e119b9..8d7e51503 100644
--- a/Completion/Builtins/_hash
+++ b/Completion/Builtins/_hash
@@ -7,7 +7,7 @@ common_args=( \
   '-d[use named directory hash table]' \
   '(-r -m -v)-f[rebuild hash table]' )
 
-case ${words[1]} in
+case ${service} in
   hash)
     _arguments -C -s \
       '(-f -m -v)-r[empty hash table]' \
diff --git a/Completion/Builtins/_source b/Completion/Builtins/_source
index aae2c7320..96b6c21bd 100644
--- a/Completion/Builtins/_source
+++ b/Completion/Builtins/_source
@@ -1,7 +1,14 @@
-#defcomp source
+#compdef source .
 
-if [[ -position 2 -1 ]]; then
-  _normal "$@"
+if [[ CURRENT -ge 3 ]]; then
+  compset -n 2
+  _normal
 else
-  _files
+  if [[ -prefix */ && ! -o pathdirs ]]; then
+    _files
+  elif [[ $service = . ]]; then
+    _files -W path
+  else
+    _files -W "(. $path)"
+  fi
 fi
diff --git a/Completion/Builtins/_which b/Completion/Builtins/_which
index aceec85a0..da78b9358 100644
--- a/Completion/Builtins/_which
+++ b/Completion/Builtins/_which
@@ -11,7 +11,7 @@ cargs=( \
 farg='-f[output contents of functions]'
 aarg='-a[print all occurences in path]'
 
-case ${words[1]} in
+case ${service} in
   whence)
     _arguments -C -s \
       '(-c -w)-v[verbose output]' \
diff --git a/Completion/Builtins/_zftp b/Completion/Builtins/_zftp
index 610af2607..ca6c59fec 100644
--- a/Completion/Builtins/_zftp
+++ b/Completion/Builtins/_zftp
@@ -11,7 +11,7 @@ _compskip=all
 
 local subcom expl curcontext="${curcontext}"
 
-if [[ $words[1] = zftp ]]; then
+if [[ $service = zftp ]]; then
   if [[ $CURRENT -eq 2 ]]; then
     _wanted commands expl sub-command \
         compadd open params user login type ascii binary mode put \
@@ -22,7 +22,7 @@ if [[ $words[1] = zftp ]]; then
   subcom=$words[2]
   curcontext="${curcontext/:zftp:/:zftp-${words[2]}:}"
 else
-  subcom=$words[1]
+  subcom=$service
 fi
 
 case $subcom in
diff --git a/Completion/User/_man b/Completion/User/_man
index 8f255c411..26f41b606 100644
--- a/Completion/User/_man
+++ b/Completion/User/_man
@@ -2,7 +2,7 @@
 
 local rep expl star approx mrd
 
-if [[ $words[1] == man ]] && (( $words[(I)-l] + $words[(I)--local-file] )); then
+if [[ $service == man ]] && (( $words[(I)-l] + $words[(I)--local-file] )); then
   _files || return 0
 fi
 
diff --git a/Completion/User/_nedit b/Completion/User/_nedit
index 5d8e329a8..f25ad503a 100644
--- a/Completion/User/_nedit
+++ b/Completion/User/_nedit
@@ -14,7 +14,7 @@ nedit_common=( \
   '*-xrm:resource:_x_resource' \
   '*:file:_files' )
 
-if [[ $words[1] = *nc ]]; then
+if [[ $service = *nc ]]; then
   _x_arguments -C \
     '(-noask)-ask[prompt if no server found]' \
     '(-ask)-noask[start a new server without asking if none found]' \