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

Re: I'm missing something with fpath.



On Jan 27,  2:30pm, Jason Price wrote:
> Subject: I'm missing something with fpath.
> Or maybe globing.

It's globbing.

> for dirname in $fpath ; do
>   autoload $dirname/*(.x:t)
> done

Dump the "for" loop.  You want a nice one-liner like

  autoload $^fpath/*(N.x:t)

where the N means to silently drop any glob pattern that doesn't match
any files.

> $FUNCTIONDIR/compinit world executable on install, and the compinstall
> function puts $FUNCTINDIR in .zshrc to be autoloaded from as above,
> couldn't this lead to a bad new user experience?
> 
> Or am I smoking crack/missing something obvious?

You {sh,c}ould drop the `x' from the glob qualifiers.  In general, there
isn't any reason for a file that contains an autoloaded function to have
its execute bit set.  The only reason for making such a file executable
is to be able to run it as a standalone shell script as well as run it as
an autoloaded function.



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