Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] bracketed-paste: change quoting style



On Wed, Aug 12, 2015 at 4:52 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 12,  3:08am, Mikael Magnusson wrote:
> }
> } 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.
>
> Hrm.  I'm tempted simply to suggest that bracketed-paste should get
> out of the way if there are no newlines in the pasted text, but
> there may be other bindings that shouldn't run.

It's also nice for avoiding various other problems, like tabs.

I feel like the widget is already getting quite DWIMmy, and what "we"
mean might not be what everyone else means. (I'm not even convinced we
all want the things it's already doing).

I would also argue that intentionally putting text in the paste buffer
to invoke widgets by pasting it is somewhat perverse, and if you want
to do it, you get to change the default configuration to do it. It
shouldn't depend on something mostly orthogonal like if there is a
newline.

I thought earlier we may even want to add a
bracketed-paste-raw/simple/literal function that just does what
bracketed-paste does in the case of being passed a parameter, but also
inserts it on the command line for you, and nothing more. It gives you
an easier knob to disable the DWIM stuff than having to write a custom
widget.

> On a different somewhat related note, bracketedpaste() lacks the tests
> for invalid multibyte characters that selfinsert() performs.
>
> } We may want to provide an alternative function to help with this case.
> } (eg, wrap bracketed-paste and quote if == http* or so.)
>
> This gets ugly if the URLs are somewhere in the middle of the pasted
> text.

Well, it's probably only worth handling if the url is the only word.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author