zsh-users
 help / color / mirror / code / Atom feed
* autoload and alias expansion question
@ 2008-02-25 16:43 Peter Hegedus
  2008-02-25 17:17 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Hegedus @ 2008-02-25 16:43 UTC (permalink / raw)
  To: zsh-users

Hello,

I have a question about alias expansion within autoloaded functions.
I'm working on a script library where I'd like to use global aliases,
but somehow can't get it to work.

To demonstrate:

hegedus@su20% echo $ZSH_VERSION
4.3.4
hegedus@su20% FPATH+=:.
hegedus@su20% alias ECHO=echo
hegedus@su20% w DATE
DATE not found
hegedus@su20% cat >foobar <<EOF
foobar () { }
alias DATE=date ; barfoo () { setopt aliases ; DATE ; ECHO OK }
EOF
hegedus@su20% autoload foobar
hegedus@su20% foobar
hegedus@su20% barfoo
barfoo: command not found: DATE
OK
hegedus@su20% w autoload
autoload: shell built-in command
hegedus@su20%

Please note I didn't use the -U flag to autoload. External aliases are
expanded, but those defined within the autoloaded script are not.
I tried using -k or -z flags, placing the definitions w/in the autoloaded
function, neither made a difference. Sourcing the file directly naturally works.

Do I miss something? Is there a way to make this work?

Thanks,
Peter


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-26  1:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-25 16:43 autoload and alias expansion question Peter Hegedus
2008-02-25 17:17 ` Peter Stephenson
2008-02-25 18:40   ` Peter Hegedus
2008-02-25 19:11     ` Bart Schaefer
2008-02-25 21:40       ` Peter Hegedus
2008-02-26  1:31         ` Bart Schaefer

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).