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

Re: PATH: autoload with explicit path



On Sun, 29 Jan 2017, Sebastian Gniazdowski wrote:

> To make the new feature complete, absolute paths must descent to
> autoloaded functions. Keeping the absolute path only to directly
> autoloaded function is ersatz. It's a half-step. I autoload single
> function, and then FPATH again takes control and does the "imagine the
> layers" thing. This is a tragedy.

Respectfully, Sebastian, I disagree.

Consider for example that several of the autoloadable functions in the
zsh distribution rely on "autoload colors".

If autoload behaved the way you suggest, this would break, because the
colors function would not be found at the absolute path from which the
calling function was loaded -- unless the writer of the calling function
has used "autoload -d", of course.  But if we're now relying on the
author to use the correct options for autoload, we're right back where
we started -- might as well rely on the author to make his function
suite "relocatable" by way of $function_source as well, and that is
now possible.

There's no magic solution that automatically covers all the variations
without cooperation from both the writer and the installer of the suite.



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