From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21227 invoked by alias); 1 Apr 2012 17:24:23 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16944 Received: (qmail 5935 invoked from network); 1 Apr 2012 17:24:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.43 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-proxyuser-ip:date:from:to:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=l1MBoFpxCarTkOmv5AyXroe0B7AuoVq3U0DDPd+AFP8=; b=POvChf1lUEGbb0jSUqhyDJDi/CLKtyvP6aY2lJrP56mGGW7Gq7XYz1T9McZaeD/Roq rd+4Ip40Dp4EqGUkhiJpGlgVJtuWqLQw8O8cLkVqVjEPr4UKeNyQECJRk3RIxH+g9dEz Et/Yl+9bFluanqNm3Yp0zNjFGvtN1uf1/MvPBJCDDBzyDKZCRtdVOXKEPjSgr1IYP1cD LgDI7xsM1gsMuqqbcBnKzbAw0S418w8a1vhC/a4eo9adbqQaI6zDEHbJRjQ1/cMyacus 8zZ9bwOfC6/AReR7Ivh6NgnE7TVE2blDlMrqXTKrlqOWbgG4+mrRgQhHyo6+yuDl5xYL +J6g== X-ProxyUser-IP: 86.6.29.42 Date: Sun, 1 Apr 2012 18:18:20 +0100 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: Catch URLs (was: "Literal" command execution) Message-ID: <20120401181820.0786a72f@pws-pc.ntlworld.com> In-Reply-To: <20120331180050.29e0f78a@internecto.net> References: <20120123205150.27077e4eea9d7be1e632508f@users.sf.net> <35878fa4ecfd0dee27367340676d7b30@voidzero.net> <20120213125759.416c7016@pwslap01u.europe.root.pri> <20120331180050.29e0f78a@internecto.net> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk0HHpSMBi6CqcQ4rrolsNwYPdOJwHAeU8gKkMrwBUoYj9k/Y1AznLTeYLJAWNAwg/sLxPC On Sat, 31 Mar 2012 18:00:50 +0200 Mark wrote: > Hmm, I have recently upgraded zsh and although I saw your patch > included, the error came back. Apparently I had fixed it manually. > Please see below. I wonder whether this method is ideal for you. > > Thanks, > Mark > > diff -pU1 old/url-quote-magic new/url-quote-magic > --- old/url-quote-magic 2012-03-31 17:58:23.646634259 +0200 > +++ new/url-quote-magic 2012-03-31 17:57:13.587013805 +0200 > @@ -68,3 +68,3 @@ zstyle -m ':url-quote-magic:\*' url-meta > zstyle -m ':url-quote-magic:\*' url-seps '*' || > - zstyle -e ':url-quote-magic:*' url-seps 'reply=(";&<>${histchars[1]}")' > + zstyle -e ':url-quote-magic:*' url-seps 'local -a reply; reply=(";&<>${histchars[1]}")' > > @@ -72,3 +72,3 @@ zstyle -m :url-quote-magic url-globbers > zstyle -e :url-quote-magic url-globbers \ > - 'zmodload -i zsh/parameter; > + 'local -a reply; zmodload -i zsh/parameter; > reply=( noglob I see what's happening now... there are functions defined internally, and I only put the "local" in the function that's only run once to define them. Your solution's probably OK, since with the "-a" the shell doesn't print the value after "local" the second time, as it would with "local reply; local reply". Still, I've kept with the spirit of what I did before... Index: Functions/Zle/url-quote-magic =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/Zle/url-quote-magic,v retrieving revision 1.4 diff -p -u -r1.4 url-quote-magic --- Functions/Zle/url-quote-magic 14 Feb 2012 15:33:02 -0000 1.4 +++ Functions/Zle/url-quote-magic 1 Apr 2012 17:17:21 -0000 @@ -84,7 +84,7 @@ zstyle -m ':urlglobber' url-other-schema # Define the "urlglobber" helper function and shorthand "globurl" alias function urlglobber { - local -a args globbed localschema otherschema + local -a args globbed localschema otherschema reply local arg command="$1" shift zstyle -s :urlglobber url-local-schema localschema '|' @@ -109,6 +109,7 @@ alias globurl='noglob urlglobber ' function url-quote-magic { setopt localoptions noksharrays extendedglob local qkey="${(q)KEYS}" + local -a reply if [[ "$KEYS" != "$qkey" ]] then local lbuf="$LBUFFER$qkey" -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/