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

Re: compinit dumps too many files for autoloading



On Mon, 4 Oct 2004, Peter Stephenson wrote:

> If I am using a complicate completion such as _perforce which defines
> its own functions, then run compinit again, all those functions are
> marked for autoloading in .zcompdump.

The patch below "fixes" it, but that cross-product null-glob causes a 
noticeable delay on my limping old 233MHz home system.

While we're on the subject, does anyone remember why the tilde (~) appears
in the following expansion of fpath in compdump (line 26 in my copy)?

_d_files=( ${^~fpath:/.}/^([^_]*|*~|*.zwc)(N) )

I can't come up with a reason you'd want patterns in fpath globbed there.
Same thing a few lines lower for _d_wfiles.

Here's the patch.  It just occurred to me that this breaks if some .zwc
files contain the function definitions but the original function files
are missing, so I'm not going to commit it just yet.

Index: Completion/compdump
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/compdump,v
retrieving revision 1.5
diff -c -r1.5 compdump
--- Completion/compdump	22 Jun 2004 07:53:03 -0000	1.5
+++ Completion/compdump	4 Oct 2004 15:57:05 -0000
@@ -103,7 +103,9 @@
 
 # Autoloads: look for all functions beginning with `_'.
 
-_d_als=(${(o)$(typeset +fm '_*')})
+_d_als=( $(typeset +fm '_*') )
+_d_als=( ${^fpath}/${^_d_als}(N) )
+_d_als=( ${(ou)_d_als:t} )
 
 # print them out:  about five to a line looks neat
 



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