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

Re: Debugging of dynamocally defined functions



On Jul 9,  7:36pm, Peter Stephenson wrote:
} Subject: Re: Debugging of dynamocally defined functions
}
} "Bart Schaefer" wrote:
} > I was fooling with almost exactly the same thing, though I'd been trying
} > to figure out a nice way to embed the line number of the eval inside the
} > `(eval)' string; e.g. for an eval on line 30 of the calling function you
} > would see something like
} > 
} > (30:eval):1: echo foo
} > (30:eval):2: echo bar

There's one other extremely minor problem with this.

I have my PS4 string set to begin with ": " and end with ";" because then
I can cut'n'paste xtrace output and the PS4 stuff is discarded as a `:'
command.  But with the parens in there around the `(eval)', I get globbing
errors when I cut'n'paste.

} Maybe we need to grab another prompt escape.

I was toying with something like %N{...}, where you could use other prompt
escapes inside the {...} the way you can use strftime escapes in %D{...}.

But really what we'd need is a %(X.T.F) sort of thing, where X is true if
you're inside an eval, so that one could write

	PS4='%(e.(%i:eval%).%N)... '

Except that then we'd also need a way for %i to specify that it's actually
the saved line number from the surrounding scope, etc. etc.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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