zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Compiled files ignore aliases
Date: Fri, 5 Feb 2016 16:33:02 +0100	[thread overview]
Message-ID: <CAKc7PVDKxBdZ+9teFDS+Zd3VCvr_JYTpiGtYNuyRicAUfPa4KA@mail.gmail.com> (raw)

Hello,
this is probably expected as aliases are applied on parsing time. But
maybe this wasn't yet recognized?

% cat 2test-script.zsh
#!/bin/zsh
alias autoload="echo Hello; autoload"
#autoload() { echo "Hello"; builtin autoload "$@" }
source "./test-script.zsh"
echo "|"${functions[abc]}"|"


% cat test-script.zsh
#!/bin/zsh
echo "Hello from script, will call a builtin"
autoload abc


Output when using alias in 2test-script.zsh and test-script.zsh is
compiled (there is .zwc file):
% ./2test-script.zsh
Hello from script, will call a builtin
|builtin autoload -X|

Output when using function in 2test-script.zsh:
% ./2test-script.zsh
Hello from script, will call a builtin
Hello
|builtin autoload -X|


Any way to have aliases working when sourcing .zwc file?

Best regards,
Sebastian Gniazdowski


             reply	other threads:[~2016-02-05 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 15:33 Sebastian Gniazdowski [this message]
2016-02-05 16:37 ` Bart Schaefer
2016-02-05 17:24   ` Sebastian Gniazdowski
2016-02-05 18:43     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKc7PVDKxBdZ+9teFDS+Zd3VCvr_JYTpiGtYNuyRicAUfPa4KA@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).