Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Modules can be built outside Zsh; custom version of autoload builtin
- X-seq: zsh-workers 40477
- From: Sebastian Gniazdowski <psprint2@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Modules can be built outside Zsh; custom version of autoload builtin
- Date: Wed, 01 Feb 2017 09:48:51 -0800
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=dJqJRPOaNAvarIKipdu7SbTLLn0=; b=tYdAnJjFaXhqpbl886CCv Fi5w2YLMPywxHGNdHmNgQ4gIo77F7f8KwhTXQYcD9twL9eAQY6/L7wOT5k6FchMp icuLTlwKGgwXlLJdk5QGP05vGQGWgUZ/CB/r//ZqQo+9wXbOdJSSuWUCD1GYjbgj JKiIfQYy2c6vFGaPneDJOk=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=smtpout; bh=dJqJRPOaNAvarIKipdu7SbTLL n0=; b=AaXFvA3Z3uYf0sP6Ius1VZdeXhqwpw38IwxlDfDUEVsxkNkWUwjQ6UJTy GVowAKo/jawCMpXWdcWpHcRplU+UvapLggBIR0anWWJSDfFzTL80UfkeuhveaMoq rtNGrz0gi93vWR6NP1vhkKFDbp7Wlr/b4vesG6I3f/Qj2F8Oi0=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello
1/ Turned out that it's easy to build Zsh modules away from complete
source. Here is a minimum build setup:
https://github.com/psprint/zplugin/tree/6a4ba014eb167cbc97353f0a59e63f62bd6442bc/zmodules
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):
# echo $ZSH_VERSION
5.3.1-dev-0
# 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:
https://github.com/psprint/zplugin/commit/bdf28d4c17d0d7e8ab86db8e3f58b15c85bf8560
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
psprint2@xxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author