Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Source mangling in $functions_source and typeset -f
- X-seq: zsh-users 27408
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Source mangling in $functions_source and typeset -f
- Date: Wed, 1 Dec 2021 06:53:11 +0000
- Archived-at: <https://zsh.org/users/27408>
- In-reply-to: <CAH+w=7ake44u-Cp5gBVkVmZqn-LnGOGZ2yOuJLmR-zjvgzKYuw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5n-hGj5ifk9KDZM29=e1u8m6nLDhxtsNgsqHKr7mLALcQ@mail.gmail.com> <CAH+w=7bkxmP9rVeiMObYBXpeayY2Hf8qDRp6r_570wkE3ZdQHA@mail.gmail.com> <272260155.566740.1638201605055@mail2.virginmedia.com> <CAH+w=7ake44u-Cp5gBVkVmZqn-LnGOGZ2yOuJLmR-zjvgzKYuw@mail.gmail.com>
Bart Schaefer wrote on Mon, Nov 29, 2021 at 09:55:07 -0800:
> On Mon, Nov 29, 2021 at 8:00 AM Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> wrote:
> >
> > > On 27 November 2021 at 17:47 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > >
> > > The parse tree only tracks the line numbers of executable code, so as
> > > to be able to update the LINENO variable and print line numbers in
> > > debug traces and prompts.
> >
> > Actually, the original line number is remembered, and can be output
> > using a prompt
>
> That's what I thought I said ...
>
> > I don't think there's any way of getting this information without actually executing
> > the code, though.
>
> ... which is exactly the problem here.
We _could_ teach zsh/parameter to emit this information, so, say,
${functions_source2[foo]} might expand to "/some/file.zsh:42", if that's
the filename and line number foo() was last defined at.
Another approach would be to use tools such as ctags.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author