zsh-workers
 help / color / mirror / code / Atom feed
* Localize MATCH, MBEGIN, etc. in _zstyle and _globquals
@ 2017-10-29 11:40 Sebastian Gniazdowski
  2017-10-29 22:07 ` Phil Pennock
       [not found] ` <etPan.59f655ed.1f659851.98a8@AirmailxGenerated.am>
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastian Gniazdowski @ 2017-10-29 11:40 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

Hello,
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.

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org

[-- Attachment #2: local_MATCH.diff.txt --]
[-- Type: text/plain, Size: 855 bytes --]

diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle
index 0e82822..7db73c0 100644
--- a/Completion/Zsh/Command/_zstyle
+++ b/Completion/Zsh/Command/_zstyle
@@ -1,7 +1,8 @@
 #compdef zstyle
 
 local state context ostate line expl ctop suf
-local nm=$compstate[nmatches] taglist patterns contexts
+local nm=$compstate[nmatches] taglist patterns contexts MATCH
+integer MBEGIN MEND
 typeset -A opt_args styles
 
 _vcs_info_hooks() {
diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals
index c855b54..915f97c 100644
--- a/Completion/Zsh/Type/_globquals
+++ b/Completion/Zsh/Type/_globquals
@@ -1,6 +1,7 @@
 #autoload
 
-local state=qual expl char delim timespec default
+local state=qual expl char delim timespec default MATCH
+integer MBEGIN MEND
 local -a alts tdisp sdisp tmatch smatch
 local -A specmap
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-05 16:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-29 11:40 Localize MATCH, MBEGIN, etc. in _zstyle and _globquals Sebastian Gniazdowski
2017-10-29 22:07 ` Phil Pennock
     [not found] ` <etPan.59f655ed.1f659851.98a8@AirmailxGenerated.am>
2017-11-02 19:09   ` Sebastian Gniazdowski
2017-11-02 19:57     ` Phil Pennock
     [not found]     ` <etPan.59fb7aea.497d9379.98a8@AirmailxGenerated.am>
2017-11-04 16:57       ` Sebastian Gniazdowski
2017-11-04 19:03         ` Bart Schaefer
2017-11-05 16:20           ` Sebastian Gniazdowski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).