On Wed, Feb 15, 2012 at 1:10 PM, Benjamin Fritz <[email protected]> wrote:
> Parentheses are still weird :-(
>
> C:\eclim-git\eclim>cmd /c echo abc)
> abc)
>

I just realized this one is invalid anyway, since MS says you need to
escape a literal ) and here the user does not

> C:\eclim-git\eclim>cmd /c (echo abc))
> ) was unexpected at this time.
>
> C:\eclim-git\eclim>cmd /c (echo abc^))
> ) was unexpected at this time.
>

Hence, neither of these work. If the user is doing the right thing,
they will have escaped the ).

> C:\eclim-git\eclim>cmd /c (echo abc^^))
> abc)
>

If the user properly escapes the ), Vim will actually execute with ^^^)

> C:\eclim-git\eclim>cmd /c (echo abc^(^))
> ) was unexpected at this time.
>

Again, user ought to have escaped the () to begin with.

> C:\eclim-git\eclim>cmd /c (echo ^"abc^)^")
> "abc)"
>

The above command would result from :!echo "abc)" so we know quoting works!

> C:\eclim-git\eclim>cmd /c (^(echo abc^) ^& ^(pause^))
> abc
> Press any key to continue . . .

And so does the auto-escaping of parens intentionally used for grouping.

I think we should do the auto-escaping, with shellxquote=(, and
additionally add a help note by :! and system() that "According to the
Microsoft documentation for cmd.exe, you either need to escape (with a
^ character) any of these characters appearing literally in your
command, or surround them in quotes ("): > ( ) @ ^ |." Should we
mention that Vim will escape them again, and also escape "?

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui