zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Add missing local -a match in promptinit
@ 2012-05-02 10:35 Mikael Magnusson
  2012-05-02 10:48 ` PATCH: Fix some more missing locals for $match Mikael Magnusson
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2012-05-02 10:35 UTC (permalink / raw)
  To: zsh-workers

Got a surprising result when trying to help daniel on irc,
% echo ${path/\/*\/(*)\/*/$match[1]}
zefram zefram /opt/bin zefram /usr/bin /bin zefram /usr/sbin /sbin zefram zefram zefram zefram zefram

---
 Functions/Prompts/promptinit |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Functions/Prompts/promptinit b/Functions/Prompts/promptinit
index 66e73a7..c29b76c 100644
--- a/Functions/Prompts/promptinit
+++ b/Functions/Prompts/promptinit
@@ -15,6 +15,7 @@ promptinit () {
   emulate -L zsh
   setopt extendedglob
   local ppath='' name theme
+  local -a match
 
   # Autoload all prompt_*_setup functions in fpath
   for theme in $^fpath/prompt_*_setup(N); do
-- 
1.7.10.GIT


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

* PATCH: Fix some more missing locals for $match
  2012-05-02 10:35 PATCH: Add missing local -a match in promptinit Mikael Magnusson
@ 2012-05-02 10:48 ` Mikael Magnusson
  2012-05-02 10:56   ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2012-05-02 10:48 UTC (permalink / raw)
  To: zsh-workers

Found by simple
% grep -rl 'match\[' Functions
There's a lot of missing ones in Completion/ in theory, but _main_complete
locals it so it should be fine.

---
 Functions/VCS_Info/vcs_info_setsys |    1 +
 Functions/Zftp/zfcd_match          |    1 +
 Functions/Zle/url-quote-magic      |    2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Functions/VCS_Info/vcs_info_setsys b/Functions/VCS_Info/vcs_info_setsys
index 1484464..7797279 100644
--- a/Functions/VCS_Info/vcs_info_setsys
+++ b/Functions/VCS_Info/vcs_info_setsys
@@ -7,6 +7,7 @@ setopt extendedglob typeset_silent
 
 local sys
 typeset -ga VCS_INFO_backends
+local -a match
 
 VCS_INFO_backends=()
 
diff --git a/Functions/Zftp/zfcd_match b/Functions/Zftp/zfcd_match
index 16de5c8..d51c717 100644
--- a/Functions/Zftp/zfcd_match
+++ b/Functions/Zftp/zfcd_match
@@ -13,6 +13,7 @@ local ZFTP_VERBOSE=45
 # should we redirect 2>/dev/null or let the user see it?
 
 local tmpf=${TMPPREFIX}zfcm$$
+local -a match
 
 if [[ $ZFTP_SYSTEM = UNIX* ]]; then
   # hoo, aren't we lucky: this makes things so much easier
diff --git a/Functions/Zle/url-quote-magic b/Functions/Zle/url-quote-magic
index 4e12253..1fd5eb2 100644
--- a/Functions/Zle/url-quote-magic
+++ b/Functions/Zle/url-quote-magic
@@ -60,7 +60,7 @@
 #       Use compsys for nested quoting analysis and command parsing.
 
 # Establish default values for styles, but only if not already set
-local -a reply
+local -a reply match
 
 zstyle -m ':url-quote-magic:\*' url-metas '*' ||
     zstyle ':url-quote-magic:*' url-metas '*?[]^(|)~#{}='
-- 
1.7.10.GIT


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

* Re: PATCH: Fix some more missing locals for $match
  2012-05-02 10:48 ` PATCH: Fix some more missing locals for $match Mikael Magnusson
@ 2012-05-02 10:56   ` Peter Stephenson
  2012-05-02 12:51     ` Mikael Magnusson
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2012-05-02 10:56 UTC (permalink / raw)
  To: zsh-workers

On Wed, 2 May 2012 12:48:12 +0200
Mikael Magnusson <mikachu@gmail.com> wrote:
> +local -a match

Ideally, these should always be

local -a match mbegin mend

because all three are set, even though the other two aren't used
anything like as much.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog


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

* Re: PATCH: Fix some more missing locals for $match
  2012-05-02 10:56   ` Peter Stephenson
@ 2012-05-02 12:51     ` Mikael Magnusson
  2012-05-02 14:25       ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2012-05-02 12:51 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

On 02/05/2012, Peter Stephenson <Peter.Stephenson@csr.com> wrote:
> On Wed, 2 May 2012 12:48:12 +0200
> Mikael Magnusson <mikachu@gmail.com> wrote:
>> +local -a match
>
> Ideally, these should always be
>
> local -a match mbegin mend
>
> because all three are set, even though the other two aren't used
> anything like as much.

Ah, forgot about those, will include in the commit. I guess I can as
well check that all places that local match also local those. And
tabcompletion just reminded me of MBEGIN/MATCH/MEND too, but that's
probably my rc.

-- 
Mikael Magnusson


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

* Re: PATCH: Fix some more missing locals for $match
  2012-05-02 12:51     ` Mikael Magnusson
@ 2012-05-02 14:25       ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2012-05-02 14:25 UTC (permalink / raw)
  To: zsh-workers

On May 2,  2:51pm, Mikael Magnusson wrote:
}
} On 02/05/2012, Peter Stephenson <Peter.Stephenson@csr.com> wrote:
} > Ideally, these should always be
} >
} > local -a match mbegin mend
} 
} Ah, forgot about those, will include in the commit. I guess I can as
} well check that all places that local match also local those. And
} tabcompletion just reminded me of MBEGIN/MATCH/MEND too, but that's
} probably my rc.

While on the subject, match/MATCH mbegin/MBEGIN mend/MEND are not
mentioned in the "Paramters Used by the Shell" documentation, nor are
they vindex()ed anywhere in the doc *.yo files.


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

end of thread, other threads:[~2012-05-02 14:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-02 10:35 PATCH: Add missing local -a match in promptinit Mikael Magnusson
2012-05-02 10:48 ` PATCH: Fix some more missing locals for $match Mikael Magnusson
2012-05-02 10:56   ` Peter Stephenson
2012-05-02 12:51     ` Mikael Magnusson
2012-05-02 14:25       ` Bart Schaefer

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).