zsh-users
 help / color / mirror / code / Atom feed
From: mark+lists@internecto.net
To: <zsh-users@zsh.org>
Subject: Catch URLs (was: "Literal" command execution)
Date: Mon, 13 Feb 2012 12:38:55 +0000	[thread overview]
Message-ID: <35878fa4ecfd0dee27367340676d7b30@voidzero.net> (raw)
In-Reply-To: <CAEcrOvBuCq2QbHMUORw-22bUU=G-=JSp=AdSoc_EFgnzhvZWuA@mail.gmail.com>

Hi,

>> I want to reduce escaping to the bare minimum. Dollars are not 
>> really a problem, but I discovered myself to escape '<' '>' and '!' 
>> too often.
> For URLs I'm using something called url-quote-magic: when I start
> writing an URL, it's detected and then all special characters are
> escaped (&, <, >, !).
> autoload -U url-quote-magic ; zle -N self-insert url-quote-magic
> This is really great for copying+pasting URLs, for example to use it 
> in wget.

It's almost really great. :)

I have setopt warncreateglobal enabled by default because it helps me 
to catch global variables that should be local, especially in my own 
functions.
Now, when I run the autoload line above and then paste an URL I am 
warned every time the URL is being escaped.

Try something like this to reproduce it. In this example I'll just use 
an arbitrary URL I happen to have on my clipboard:

setopt warncreateglobal
autoload -U url-quote-magic; zle -N self-insert url-quote-magic
curl -LO 
https://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git;a=blob_plain;f=queue-3.2/mm-fix-up-thp-spin_is_locked-bugs.patch;hb=50c8f68647a605333fe78c86966e802c07a105c0

output:
8 of these:
url-quote-magic:68: array parameter reply created globally in function
url-quote-magic:72: array parameter reply created globally in function

I'm not sure how to fix this, tips for that are appreciated.

Mark


  reply	other threads:[~2012-02-13 12:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23 19:51 "Literal" command execution Yuri D'Elia
2012-01-23 22:13 ` Damien Thébault
2012-02-13 12:38   ` mark+lists [this message]
2012-02-13 12:57     ` Catch URLs (was: "Literal" command execution) Peter Stephenson
2012-02-14 15:27       ` Mark van Dijk
2012-03-31 16:00       ` Mark
2012-04-01 17:18         ` Peter Stephenson
2012-04-02 16:13           ` Mark van Dijk
2012-01-23 22:32 ` "Literal" command execution Bart Schaefer
2012-01-24 11:52   ` Yuri D'Elia
2012-01-24 21:12     ` Bart Schaefer

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=35878fa4ecfd0dee27367340676d7b30@voidzero.net \
    --to=mark+lists@internecto.net \
    --cc=zsh-users@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).