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

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



On 29 Oct 2017 at 23:07:21, Phil Pennock (zsh-workers+phil.pennock@xxxxxxxxxxxx) wrote:
> _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.

Worth noting it doesn't localize $mbegin and $mend. Also, it uses local not local -a for $match, which is a minor thing.

> 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?

I'm little not current with regex match variables, so not sure what you mean by "=~" variables, and why not localize non-BASH_REMATCH variables too (or if it's that Zsh code doesn't use them, then it's ok for me, logical to not localize them).

-- 
Sebastian Gniazdowski
psprint /at/ zdharma.org



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