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

Re: separating functions, fpath, and autoload



In more words:

'autoload foo' marks 'foo' as the name of a function that will be
instantiated upon the first call to it.  After calling foo, you'll
see the actual definition of foo: 'autoload foo; foo; which foo'.
You can pass +X to 'autoload' to load the function immediately
(before it's called).

More below.

Pier Paolo Grassi wrote on Mon, 13 Aug 2018 15:56 +0200:
> that should be correct, the autoload will be executed when you first invoke
> msg, have you tried invoking it?
> Il giorno lun 13 ago 2018 alle 15:50 TJ Luoma <luomat@xxxxxxxxx> ha scritto:
> > if [ -d "$ZDOTDIR/functions" ]
> > then
> > fpath=($ZDOTDIR/functions $fpath)

Another way:

fpath=( $ZDOTDIR/functions(N) $fpath )

or even

fpath[1,0]=( $ZDOTDIR/functions(N) )

then you don't need an if.



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