Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: functions -t
- X-seq: zsh-users 27231
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
- Cc: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: Re: functions -t
- Date: Tue, 12 Oct 2021 20:35:29 -0700
- Archived-at: <https://zsh.org/users/27231>
- In-reply-to: <CAP+y1xA7=UkvX8isXaSAp0Dmgk5Cr_P+rH+eMgRb1dWgpUuzVw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAP+y1xAZw0qKse52Xk5j1VbfzhcBC7pH_qLRmfgtrSL1oeywQg@mail.gmail.com> <CAP+y1xA7=UkvX8isXaSAp0Dmgk5Cr_P+rH+eMgRb1dWgpUuzVw@mail.gmail.com>
On Tue, Oct 12, 2021 at 8:07 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
>> > trace_funcname
>> funcname is executed and traced
>> > funcname
>> funcname is executed and traced (but I was expecting no tracing here)
>>
>> is this expected behaviour
Yes. Tracing of individual functions is not an option controlled by
setopt. Only the latter are restored by using "setopt localoptions".
>> and how can I disable the tracing after trace_funcname has exited without using functions +t funcname manually, if is possible?
It's not clear what you mean by "manually" ... so how about:
trace_funcname(){
emulate -L zsh # or not
{
functions -T funcname
funcname
} always {
functions +T funcname
}
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author