Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH v6] regexp-replace and ^, word boundary or look-behind operators (and more).
- X-seq: zsh-workers 54701
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH v6] regexp-replace and ^, word boundary or look-behind operators (and more).
- Date: Sun, 7 Jun 2026 14:15:58 +0100
- Archived-at: <https://zsh.org/workers/54701>
- In-reply-to: <CAHYJk3QEiJ0_x20dK4TOeztb5xVP3sx5=LB1upW54nmwX5f5AQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- References: <20200101140343.qwfx2xaojumuds3d@chaz.gmail.com> <20210430061117.buyhdhky5crqjrf2@chazelas.org> <CAH+w=7bHxSbFr60ZU0+oZ6+qEejhfBYTzvL7=aXadY5XzWtSzw@mail.gmail.com> <20210505114521.bemoiekpophssbug@chazelas.org> <20240308153050.u63fqtcjyr2yewye@chazelas.org> <20240309130310.5zovit5jk6l4rnak@chazelas.org> <20240310195201.c53tzhgcyk5qgi27@chazelas.org> <CAHYJk3QBHeR9TTGtpRu4SapMAWo9OC-YQ71cO8aSDcuJ8QEp_Q@mail.gmail.com> <aiUvWWVf9MYQPa4m@chazelas.org> <CAHYJk3QEiJ0_x20dK4TOeztb5xVP3sx5=LB1upW54nmwX5f5AQ@mail.gmail.com>
2026-06-07 12:36:53 +0200, Mikael Magnusson:
[...]
> setopt functionargzero does not take effect when we have already entered the
> function, so use $funcstack[1] instead.
[...]
Thanks. I have to admit I'm a bit baffled as to how I ended up
adding that (and that I would have thought about the case where
functionargzero is unset in the first place).
Probably by testing in other emulation modes.
If $0 == functionname is not restored by emulate -L zsh, that
would suggest we'd need to replace $0 with $funcstack[1] in all
functions we expect to work whatever the user's set of options.
I see $funcstack doesn't work when zsh is *started* in sh/ksh/csh
emulation, but I wouldn't expect those instances to use
autoloaded functions anyway.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author