Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Localize MATCH, MBEGIN, etc. in _zstyle and _globquals



On 2017-10-29 at 12:40 +0100, Sebastian Gniazdowski wrote:
> I was searching for regex usage (=~) and didn't find anything
> meaningful (would replace with (#b) or (#m) so that e.g. default
> static build works fine). However found (#m) use and not defined local
> MATCH, MBEGIN, MEND. To not surprise user with overwriting his
> matching results, I've localized those parameters in two Zsh-related
> completions.

_main_complete localizes `match` already.  So if we don't localize all
of them in the same place then we're risking inconsistency, no matter
what.

Anyone know of a good reason to not just localize _all_ of the =~
non-BASH_REMATCH variables in _main_complete so that they're always
isolated to the completion-system, if =~ or -regex-match or -pcre-match
is used within the completion system?

-Phil



Messages sorted by: Reverse Date, Date, Thread, Author