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

Re: Crash of 4.2.0-dev-1



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> typed:
: On Apr 11,  8:09am, Geoff Wing wrote:
[...]
:     autoload +X -k kshtest
[...]
:} I don't understand why this is the correct error
:
: Because files loaded with kshautoload have to contain the full function
: definition, like so:
:
:     kshtest() {
: 	print "Running kshtest"
: 	unfunction kshtest
:     }

OK, according to the manual zshbuiltins(1) in autoload:

 ... With ksh-style autoloading, the contents of the file will not be
     executed immediately.  Instead, the function created will contain
     the contents of the file ...

I read this to mean the function created has as its body the contents of
the file and as such it wasn't strictly necessary to define the function
itself (guess I wasn't paying too much attention).  Oh, and now I've just
read further down (Oops).

: Whereas zsh expects it to have been defined as:
:
:     kshtest () {
: 	kshtest () {
: 	    print "Running kshtest"
: 	    unfunction kshtest
: 	}
: 	kshtest "$@"
:     }

This is what I get.

It's all working fine for me.  I'll try it without the zsh-mem stuff to
see if that's been avoiding the problem for me. 

Regards,
-- 
Geoff Wing



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