Re: [PATCH v6] regexp-replace and ^, word boundary or look-behind operators (and more).
Stephane Chazelas <[email protected]>
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <[email protected]> |
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