From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: WARN_CREATE_GLOBAL and url-quote-magic
Date: Fri, 11 Dec 2015 13:50:47 +0000 [thread overview]
Message-ID: <20151211135047.7b1c9847@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20151211130507.GA14502@cventin.lip.ens-lyon.fr>
On Fri, 11 Dec 2015 14:05:07 +0100
Vincent Lefevre <vincent@vinc17.net> wrote:
> I don't think that the following has been reported yet. Run "zsh -f"
> and:
>
> setopt WARN_CREATE_GLOBAL
> autoload -Uz url-quote-magic
> zle -N self-insert url-quote-magic
>
> Then type "echo a:b ". After typing the space after "a:b", I get:
>
> cventin% echo a:b
> url-quote-magic:12: array parameter match created globally in function url-quote-magic
> url-quote-magic:12: array parameter mbegin created globally in function url-quote-magic
> url-quote-magic:12: array parameter mend created globally in function url-quote-magic
> cventin% echo a:b
Yes, it's the (#b) in the pattern creating those parameters. All such
instances in distributed functions should be suitably protected.
I don't think there's any chance of needing the result in a higher scope
this time...
pws
diff --git a/Functions/Zle/url-quote-magic b/Functions/Zle/url-quote-magic
index 0e49573..7ee281e 100644
--- a/Functions/Zle/url-quote-magic
+++ b/Functions/Zle/url-quote-magic
@@ -115,7 +115,7 @@ alias globurl='noglob urlglobber '
function url-quote-magic {
setopt localoptions noksharrays extendedglob
local qkey="${(q)KEYS}"
- local -a reply
+ local -a reply match mbegin mend
if [[ "$KEYS" != "$qkey" ]]
then
local lbuf="$LBUFFER$qkey"
next prev parent reply other threads:[~2015-12-11 13:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-11 13:05 Vincent Lefevre
2015-12-11 13:50 ` Peter Stephenson [this message]
2015-12-11 16:52 ` Bart Schaefer
2015-12-11 16:55 ` Peter Stephenson
2015-12-11 17:11 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151211135047.7b1c9847@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).