* PATCH: Re: Default fpath
@ 2000-03-16 9:04 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-03-16 9:04 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote:
> ...
>
> Autoload +X is supposed to promise that the autoloaded function is not
> executed. Unfortunately, in the kshautoload style, you have to execute
> the code in order to get the function defined, which may mean executing
> other code that's in the file but not inside any function body.
>
> For at least one intended use of "autoload +X" -- finding out whether
> the function is in fpath and is syntactically correct -- other code in
> the file should NOT be executed; rather, you want the effect of the
> `[[ -o kshautoload ]] && run-myself "$@"' trick to take effect at the
> time an actual *call* to the function is made.
>
> At the time that I added loadautofn() there wasn't any way to achieve
> that result, but perhaps now with wordcode it'll be possible.
Ah. Hm. I thought of `autoload +X' only as some kind of forced-loading
and in that case we would have to execute ksh-autoloaded functions
once.
Syntax checking is possible with zcompile, btw:
zcompile /dev/null <path-to-func> ...
or
zcompile -c /dev/null <func> ...
Hm, no patch for the autoload thing yet, until someone else makes a
decision here.
The patch fixes a bug where loadautofn(), when called from
eval_autoload() could leave an invalid funcdef field in a shfunc
struct.
Bye
Sven
diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c Thu Mar 16 09:45:39 2000
+++ Src/exec.c Thu Mar 16 09:55:58 2000
@@ -3211,6 +3211,7 @@
if (prog == &dummy_eprog) {
zerr("%s: function definition file not found", shf->nam, 0);
+ shf->funcdef = prog;
return 1;
}
if (!prog)
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-03-16 9:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-16 9:04 PATCH: Re: Default fpath Sven Wischnowsky
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).