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

Re: sourcing a sh file in zsh



On 2009-01-25 at 21:39 +0000, Peter Stephenson wrote:
> On Sat, 24 Jan 2009 15:26:43 -0800
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > } There's still the issue of retaining the emulation mode for functions
> > } defined in that mode; I agree we really ought to tackle that to make
> > } the new functionality properly useful. I expect Bart has ideas on the
> > } next step; how far will we need to go?
> > 
> > I refer you to workers/26336 where Phil makes some comments about how
> > he'd modify the wordcode to handle this.
> 
> I can't offhand think of a case that needs to be that complicated.
> Either you run a chunk of code using "emulate", or you have a shell
> function, possibly defined in such a chunk, where sticking the flags in
> the shfunc structure for future reference is good enough.  Where would
> you need something more than that?

I need to sit down and trace out the mechanics of the existing code to
understand the ways that invocation of a function can occur.  What I
wrote was:

----------------------------8< cut here >8------------------------------
The problem is how to decide if a function needs a new option; I haven't
looked too closely but I believe that functions are invoked from each
other directly via the Eprog code, rather than dispatch through the
shfunctab shfunc entries, so it's not viable to go via extending shfunc
(pity).
----------------------------8< cut here >8------------------------------

If I was wrong, and all function invocation goes via the shfunc entries,
then (a) that's much easier and (b) I'm very happy.

-Phil



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