Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
Date: Fri, 13 May 2016 22:20:39 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh hackers list <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)
Message-ID: <20160513222039.GA2425@tarsus.local2>
References: <20160506205309.GY5029@sym.noone.org>
 <160508115026.ZM10022@torch.brasslantern.com>
 <20160509141306.GA18211@cventin.lip.ens-lyon.fr>
 <160509084143.ZM13554@torch.brasslantern.com>
 <20160510085833.GA20332@cventin.lip.ens-lyon.fr>
 <160510125848.ZM1686@torch.brasslantern.com>
 <20160513092348.GB18186@zira.vinc17.org>
 <CAH+w=7YYkto7u1WNcfmTs30o1wVGF4VRwnKmJtFz=5K4iLLp5A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <CAH+w=7YYkto7u1WNcfmTs30o1wVGF4VRwnKmJtFz=5K4iLLp5A@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 38487

Bart Schaefer wrote on Fri, May 13, 2016 at 04:06:45 -0700:
> Stepping outside the box a little here -- when url-quote-magic was
> written there was no such thing as the zle-line-pre-redraw hook.  It
> might be that a better approach would be to examine the entire buffer
> in that hook after the paste has finished and apply the quoting
> retroactively, rather than to do it character by character during the
> paste.  (On the other hand zle-line-pre-redraw is thoroughly co-opted
> by popular plugins like zsh-syntax-highlighting.)

So perhaps it's time to permit registering multiple functions to be
invoked at pre-redraw, as proposed in 37639?  This way, z-sy-h and
url-quote-magic could each register a pre-redraw hook function.

zle-line-pre-redraw has not yet been released: its interface can be
changed arbitrarily.  z-sy-h will be updated to use whatever interface
zsh-5.3 will be released with.

Cheers,

Daniel

