zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Peter Stephenson <p.stephenson@samsung.com>,
	"zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [BUG] Anonymous functions cause funcfiletrace to produce function-relative line numbers
Date: Sat, 16 Dec 2017 16:33:23 -0600	[thread overview]
Message-ID: <2FD3012D-489A-4868-8233-24D1488CE3E9@dana.is> (raw)
In-Reply-To: <CAH+w=7ZMpGbduUgRw-N5pO-ArAUEptA=G3tN=u6kd7V4UcXH2g@mail.gmail.com>

On 16 Dec 2017, at 15:10, Bart Schaefer <schaefer@brasslantern.com> wrote:
>Does the same thing happen whenever a function is defined like this --
>...
>--  in an autoload file (zsh included)?

I wasn't sure what you meant here, since i am auto-loading the functions defined
that way. Someone on IRC suggested maybe you meant something like this?

  % < foo
  #
  panic() {
    print -rC2 -- $functrace $funcfiletrace
    exit 1
  }
  puts() {
    panic
  }
  puts

  % < tracetest.zsh
  fpath=( . )
  autoload -Uz foo
  main() {
    () { foo }
  }
  main

If that's the case, i actually *don't* see the problem there (with pws's patch):

  puts:1           /Users/dana/.../zsh/foo:7
  foo:9            /Users/dana/.../zsh/foo:9
  (anon):0         tracetest.zsh:4
  main:1           tracetest.zsh:4
  tracetest.zsh:6  tracetest.zsh:6

All those numbers look correct to me.

I also repeated my previous test case, but with `autoload -Uk` instead of `-Uz`,
and i got the same result as before, so the problem evidently isn't limited to
the combination of zsh-style auto-loading + ksh-style definitions.

(Let me know if i've misinterpreted your question)

dana


  reply	other threads:[~2017-12-16 22:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171210232854epcas2p2f9d4f0ac2ad31feb5a54d61da49e7140@epcas2p2.samsung.com>
2017-12-10 23:28 ` dana
2017-12-11  9:41   ` Peter Stephenson
2017-12-11 10:12     ` Peter Stephenson
2017-12-11 21:57       ` dana
2017-12-15 10:21         ` Peter Stephenson
2017-12-15 18:45           ` dana
2017-12-16 21:10             ` Bart Schaefer
2017-12-16 22:33               ` dana [this message]
2017-12-18  9:01             ` Peter Stephenson
2017-12-20 17:39               ` Peter Stephenson
2017-12-20 22:26                 ` dana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2FD3012D-489A-4868-8233-24D1488CE3E9@dana.is \
    --to=dana@dana.is \
    --cc=p.stephenson@samsung.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).