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

Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug



Hello,
with Zplugin I avoid setting FPATH by manually constructing autoload
function stub:

            eval "function $func {
                local FPATH="$PLUGIN_DIR":"${FPATH}"
                builtin autoload -X ${opts[*]}
            }"

This way one can have say 10 plugins loaded and still clean $FPATH.
What I astonishingly realized today is that functions autoloaded this
way can further use autoload builtin purely normally. FPATH visible
from the specially-autoloaded function is modified, has the required
added component, and builtin autoload works as expected (even with
<5.1 Zsh, it has a more specific manual autoload stub).

However once in 3 days I get "function definition file not found" not
found message. What could be the reason? I'm using non-optimized
zsh-5.2-dev-2 and could do some actions to track this, but what could
they be?

Best regards,
Sebastian Gniazdowski



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