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

Modules can be built outside Zsh; custom version of autoload builtin

1/ Turned out that it's easy to build Zsh modules away from complete
source. Here is a minimum build setup:


Tested this on OS X. I can load module built with Zsh 5.3.1 features
even on Apple-provided 5.0.8. It's only that lazy binding will fail, if
I call non-existent (in 5.0.8) function. So, plugin creators can
actually provide binary parts, what I'm intending to do too, in Zplugin.

2/ I needed the following to work (for Zplugin):

# mkdir ~/myfunctions
# mv /usr/local/share/zsh/5.3.1-dev-0/functions/calendar* ~/myfunctions
# autoload ~/myfunctions/calendar
# calendar
calendar:36: calendar_scandate: function definition file not found

Turned out that it's possible to overwrite bin_autoload pointer with own
function, provided in module. Patch that makes the above work:


I did there:

#define PM_ABSPATH_USED       (1<<12) /* (function): loaded using
absolute path (shared with PM_EXPORTED) */

I think it's good idea to add also in upstream Zsh, to detect
absolute-path origin of function.

  Sebastian Gniazdowski

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