From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11890 invoked by alias); 1 Feb 2017 17:48:59 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40477 Received: (qmail 24050 invoked from network); 1 Feb 2017 17:48:59 -0000 X-Qmail-Scanner-Diagnostics: from new2-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.224):SA:0(-0.4/5.0):. Processed in 2.646875 secs); 01 Feb 2017 17:48:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint2@fastmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 66.111.4.224 as permitted sender) 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= X-ME-Sender: Message-Id: <1485971331.144984.867001872.61A8E38E@webmail.messagingengine.com> From: Sebastian Gniazdowski To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-e9b51b02 Subject: Modules can be built outside Zsh; custom version of autoload builtin Date: Wed, 01 Feb 2017 09:48:51 -0800 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@fastmail.com