about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-11-06 17:14:59 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-11-06 17:14:59 +0000
commitb1d9e5d5faada13e2f2f53b32872f0e85aaee6e9 (patch)
treee1aa38ec079205bfc9f9555c0fc7df9504775f25
parentda0dfc62df8ca884cdc27bb9fd26e520873e4c71 (diff)
downloadzsh-b1d9e5d5faada13e2f2f53b32872f0e85aaee6e9.tar.gz
zsh-b1d9e5d5faada13e2f2f53b32872f0e85aaee6e9.tar.xz
zsh-b1d9e5d5faada13e2f2f53b32872f0e85aaee6e9.zip
22972: limit autoload completion to functions not yet registered.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Zsh/Command/_typeset7
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b75cc367b..1a2922049 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-11-06  Peter Stephenson  <pws@csr.com>
 
+	* 22972: Completion/Zsh/Command/_typeset: autoload completion
+	is limited to functions not yet registered.
+
 	* 22971: Src/exec.c, Src/jobs.c: don't allow job control
 	on jobs in current shell and sanitize error message used.
 
diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset
index 587ce03f9..9c9165563 100644
--- a/Completion/Zsh/Command/_typeset
+++ b/Completion/Zsh/Command/_typeset
@@ -63,7 +63,7 @@ esac
 
 [[ -z "${words[(r)-*[aA]*]}" ]] || func=p
 [[ -z "${words[(r)-*f*]}" ]] || func=f
-   
+
 for ((i=1;i<=$#use;++i)); do
   args+=( ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[Uut]]:+$func}]} )
 done
@@ -75,7 +75,10 @@ if [[ "$state" = vars_eq ]]; then
     if (( $+opt_args[-w] ));then
       _wanted files expl 'zwc file' _files -g '*.zwc(-.)'
     elif [[ $service = autoload || -n $opt_args[(i)-[uU]] ]]; then
-      _wanted functions expl 'shell function' compadd - ${^fpath}/*(:t)
+      args=(${^fpath}/*(:t))
+      # Filter out functions already loaded or marked for autoload.
+      args=(${args:#(${(kj.|.)~functions})})
+      _wanted functions expl 'shell function' compadd -a args
     else
       _functions
     fi