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

Re: wrapper functions in modules



On Dec 15,  1:03pm, Sven Wischnowsky wrote:
} Subject: Re: wrapper functions in modules
}
} Bart Schaefer wrote:
} > Is the new first parameter of doshfunc() needed any longer?
} 
} [For those who don't want to look at the code: the argument is the
} name of the function to be executed.]
} 
} I added the argument since modules may be interested in it

Hm.  I'm not sure that modules *ought* to be interested in it, but ...

One thing a wrapper function might legitimately be interested in is the
context in which it was called.  By that I mean, the wrapper might want
to do something different if the function is being run by the completion
widget code (the call to doshfunc() in zle_main.c), the compctl -K code
or -Y code (zle_tricky.c), or the signal traps (signals.c).  The signal
handlers can sort of be determined by examination of the name, but that's
not what I'd call the best way to do it (e.g. it's possible to invoke the
trap functions manually without a signal having been received), and that
doesn't work for the other cases.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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