about summary refs log tree commit diff
path: root/Doc/Zsh/func.yo
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-25 09:34:23 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-25 09:34:23 +0000
commit1fe3b5622443f16f1d64a250a648db595090670a (patch)
tree8ae49f263de648900eb54ef85beeee410e18df22 /Doc/Zsh/func.yo
parentf2217a01887e63ad9239b9a0e53606e233550580 (diff)
downloadzsh-1fe3b5622443f16f1d64a250a648db595090670a.tar.gz
zsh-1fe3b5622443f16f1d64a250a648db595090670a.tar.xz
zsh-1fe3b5622443f16f1d64a250a648db595090670a.zip
zsh-workers/8404
Diffstat (limited to 'Doc/Zsh/func.yo')
-rw-r--r--Doc/Zsh/func.yo23
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/Zsh/func.yo b/Doc/Zsh/func.yo
index 847381c8d..c2462b7dd 100644
--- a/Doc/Zsh/func.yo
+++ b/Doc/Zsh/func.yo
@@ -74,6 +74,29 @@ and any subsequent calls.  Without tt(KSH_AUTOLOAD) set, it will produce
 the initialization message on the first call, and the other message on the
 second and subsequent calls.
 
+It is also possible to create a function that is not marked autoloaded,
+yet loads its own definition by searching tt(fpath): `tt(autoload -X)',
+when called from within a shell function tt(myfunc), is equivalent to:
+
+example(unfunction myfunc
+autoload myfunc
+myfunc "$@")
+
+In fact, the tt(functions) command outputs `tt(builtin autoload -X)' as
+the body of an autoloaded function.  A true autoloaded function can be
+identifed by the presence of the comment `tt(# undefined)' in the body,
+because all comments are discarded from defined functions.  This is done
+so that
+
+example(eval "$(functions)")
+
+produces a reasonable result.
+
+To load the definition of an autoloaded function tt(myfunc) without
+executing tt(myfunc), use:
+
+example(autoload +X myfunc)
+
 sect(Special Functions)
 The following functions, if defined, have special meaning to
 the shell: