Zsh Mailing List Archive
Messages sorted by:
Re: PM_TAGGED and PM_TAGGED_LOCAL being set simultaneously (functions -T -t f)
- X-seq: zsh-workers 48591
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PM_TAGGED and PM_TAGGED_LOCAL being set simultaneously (functions -T -t f)
- Date: Thu, 15 Apr 2021 19:38:28 +0100
- Archived-at: <https://zsh.org/workers/48591>
- In-reply-to: <20210415162115.GB1002@tarpaulin.shahaf.local2>
- List-id: <zsh-workers.zsh.org>
- References: <20210414150337.GA23748@tarpaulin.shahaf.local2> <firstname.lastname@example.org> <20210415162115.GB1002@tarpaulin.shahaf.local2>
On Thu, 2021-04-15 at 16:21 +0000, Daniel Shahaf wrote:
> > > f() g
> > > g() :
> > > functions -T f
> > > functions -t f
> > > f
> > >
> > > Should XTRACE be on or off when g is run? Or should an error be raised
> > > before g is called?
> > >
> > > And if -t were set first and -T second?
> > The way the documentation is written:
> > The flag -t turns on execution tracing for this function;
> > the flag -T does the same, but turns off tracing for any named (not
> > anonymous) function called from the present one, unless that func‐
> > tion also has the -t or -T flag.
> > makes it sound as if turning off for called functions is more
> > powerful behaviour, in which case -T should always be used if
> > specified. But it doesn't actually *say* that and could be
> > rewritten anyway, so it's not much of a steer. Having one flag
> > cause another to be ignored is pretty standard behaviour and
> > relatively straightforward to implement, though.
> So, to be clear, you're proposing that setting either flag should unset
> the other? Sounds good to me; just making sure we're on the same page.
Actually, the suggestion was even simpler --- leave them both set, but
just allow the -T behaviour to be used if both are set. I think this is
how it's currently implemented, so it would just mean updating the
However, actually unsetting the other one is entirely rational, too.
Which is least surprising depends how you think of the options: whether you
think of the option settings as strict alternatives, or you think of
them as two separate options that happen to have an overlapping function
of which you have to pick one. So I can't really express a preference,
except to say if there's no good reason to change we should just
document what we have.
Messages sorted by: