Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: doshfunc



Bart Schaefer wrote:

> ...
> 
> The code that does `name "$@"' in eval_autoload() is assembling a command
> to pass to bin_eval().  It doesn't append anything to the function def'n.

Err, right, sorry.  I was far too hasty yesterday.  It's printshfuncnode().

> ...
> 
> That error message came from line 3253, not line 3381.

No, 3278 (in an unpatched exec.c).

> } or:
> } 
> }   % rm -f foo.zwc
> }   % echo 'bar() { echo foobar }' >foo
> }   % setopt kshautoload
> }   % fpath=(. $fpath)
> }   % autoload foo
> }   % foo
> }   zsh: foo: function not defined by file
> 
> Same thing there; the error is from line 3253.
> 
> Once again, what I want to know is how you reach line 3372 with EF_RUN in
> the Eprog flags, and hence get the error from line 3381.

You need an autoloaded function that unfunctions itself:

  % echo 'foo() { echo foo }' >foo
  % echo 'unfunction foo' >> foo
  % fpath=(. $fpath)
  % autoload +Xk foo
  % foo
  zsh: foo: function not defined by file

And this time it's the one on line 3381.


Bye
  Sven


-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author