zsh-workers
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: Re: bracket-paste-magic adds backslashes inside a quoted string if URL is pasted ("regression" compared to pre-5.1 url-quote-magic)
Date: Tue, 10 May 2016 10:58:33 +0200	[thread overview]
Message-ID: <20160510085833.GA20332@cventin.lip.ens-lyon.fr> (raw)
In-Reply-To: <160509084143.ZM13554@torch.brasslantern.com>

On 2016-05-09 08:41:43 -0700, Bart Schaefer wrote:
> On May 9,  4:13pm, Vincent Lefevre wrote:
> } Subject: Re: bracket-paste-magic adds backslashes inside a quoted string i
> }
> } On 2016-05-08 11:50:26 -0700, Bart Schaefer wrote:
> } > You want
> } > 
> } >     zstyle :bracketed-paste-magic paste-init backward-extend-paste
> } > 
> } > so that the quote marks that are already on the line are treated as
> } > part of the pasted text.
> } 
> } Shouldn't this be the default behavior?
> 
> We had quite a bit of discussion on related topics when bracketed-paste
> was added.  The general idea is that a paste is treated as a unit, and
> the default behavior of bracketed-paste-magic is to restrict its action
> to remain "inside" that unit.

I'm not sure what you call "unit", but IMHO, the notion of unit
should be different from the notion of argument. For instance,
I would agree that a URL could be regarded as a unit, and after

  echo "The URL is: 

it makes sense to paste a URL. So, the context should matter.

> backward-extend-paste is appropriate when bracketed-paste-magic combines
> with url-quote-magic, but not necessarily so in other cases.  paste-init
> (and paste-finish) can be used for this kind of thing generically; the
> backward-extend action is included by default, but has to be turned on.

Or perhaps there should be a function that does all the work for
URL handling, e.g. currently

  autoload -Uz url-quote-magic
  zle -N self-insert url-quote-magic
  autoload -Uz bracketed-paste-magic
  zle -N bracketed-paste bracketed-paste-magic
  zstyle :bracketed-paste-magic paste-init backward-extend-paste

in case there would be future changes.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


  reply	other threads:[~2016-05-10  8:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 20:53 Axel Beckert
2016-05-08 18:50 ` Bart Schaefer
2016-05-09 14:13   ` Vincent Lefevre
2016-05-09 15:41     ` Bart Schaefer
2016-05-10  8:58       ` Vincent Lefevre [this message]
2016-05-10 19:58         ` Bart Schaefer
2016-05-13  9:23           ` Vincent Lefevre
2016-05-13 11:06             ` Bart Schaefer
2016-05-13 12:19               ` Vincent Lefevre
2016-06-02  7:20                 ` undo problems/crashes (was Re: bracket-paste-magic ...) Bart Schaefer
2016-05-13 22:20               ` bracket-paste-magic adds backslashes inside a quoted string if URL is pasted ("regression" compared to pre-5.1 url-quote-magic) Daniel Shahaf
2016-05-14  1:33                 ` Mikael Magnusson
2016-05-14  3:00                   ` Daniel Shahaf
2016-05-15 11:59                     ` Bart Schaefer
2016-05-19 21:14                       ` Daniel Shahaf
2016-06-02  7:06                         ` zle hook conventions (was Re: bracket-paste-magic ...) Bart Schaefer
2016-06-03 20:40                           ` Daniel Shahaf
2016-06-03 22:51                             ` Bart Schaefer
2016-06-04 16:57                               ` Daniel Shahaf
2016-06-10 17:36                           ` Daniel Shahaf
2016-06-10 19:51                             ` 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=20160510085833.GA20332@cventin.lip.ens-lyon.fr \
    --to=vincent@vinc17.net \
    --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).