Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] bracketed-paste: change quoting style
- X-seq: zsh-workers 36114
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] bracketed-paste: change quoting style
- Date: Wed, 12 Aug 2015 03:08:04 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7Snra4eUIClvuxW6xoOVAdfeacWqrmaGu0qmkzy7xHY=; b=HP2Y8iDNs1KmpDJYAuuOyHXJTbZx0hGmoSFWkzacLf01LvWlMCXgTuGXqooXjQA9Ue WIApmZvKnGVgxSSxHL0V36IXOeg4CAd9gu0kS3Rbkzbx/Ogd2//VnttDdKYIz1+nUE1L /Q/ksJXg77rdF5knxGWR0KvEKy5t5doDbBytV31ew9p2OwDVKzttb4C/+QmZgqQcAMHi 9UYHrMHH8eDkRPl4yvRGeBHgG4MvE/eCECURX1zEkYBTmQnL5yLcy6hGgtwgD/fgTFOq mUlUl1Pcwj//kugYVPci5j8h4yFW6U7AK2DakZRNh87kOWbEZDhj6xzw0y8S+CDML5l9 MSaw==
- In-reply-to: <20150811220922.GF1859@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20150811220922.GF1859@tarsus.local2>
On Wed, Aug 12, 2015 at 12:09 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Make bracketed-paste use ''-quoting instead of \-quoting (when NUMERIC
> is nonzero).
>
> It's a bikeshed, of course, but I think '' is more readable.
>
> diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
> index 502e41e..5f2a580 100644
> --- a/Src/Zle/zle_misc.c
> +++ b/Src/Zle/zle_misc.c
> @@ -779,7 +779,7 @@ bracketedpaste(char **args)
> int n;
> ZLE_STRING_T wpaste;
> wpaste = stringaszleline((zmult == 1) ? pbuf :
> - quotestring(pbuf, NULL, QT_BACKSLASH), 0, &n, NULL, NULL);
> + quotestring(pbuf, NULL, QT_SINGLE_OPTIONAL), 0, &n, NULL, NULL);
> cuttext(wpaste, n, CUT_REPLACE);
> if (!(zmod.flags & MOD_VIBUF)) {
> kct = -1;
If we go here, we may as well allow the numeric to pick which quoting
style to use. :)
On a related note, someone on irc was confused about why
url-quote-magic stopped working in git, and it's of course because
bracketed pasting causes its self-insert hook to never run. We may
want to provide an alternative function to help with this case. (eg,
wrap bracketed-paste and quote if == http* or so.)
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author