Am 15.02.2012 04:28, schrieb mattn:
Ehm, thus 'shellxquote' should be "(, and we should turn that into )"
for the tail? It's possible, but I wonder where it breaks now.

Yes, I wonder:

* What is a problem
* Why 7.3.443 is needed.

Summary what I remember so far, and a suggestion at the end.
Please correct mistakes.

------------------------------------------
Bug (before the patch):
    shellcmdflag: /c
    shellxquote: empty

user executes       :!"my editor.exe" "my file.txt"
vim executes        cmd /c "my editor.exe" "my file.txt"
cmd executes        my editor.exe" "my file.txt
                    (obviously wrong)

Problem: cmd sometimes strips outer quotes (and doesn't provide an
         option to force keeping the quotes)
Solution: always add surrounding quotes and force removing them with /s

Patch:
    shellcmdflag: /s /c
    shellxquote: "

Yeah, this works now:
user executes       :!"my editor.exe" "my file.txt"
vim executes        cmd /s /c ""my editor.exe" "my file.txt""
cmd executes        "my editor.exe" "my file.txt"

------------------------------------------
Bug (with the patch)
    shellcmdflag: /s /c
    shellxquote: "

user executes       :!editor "my&file.txt"
vim executes        cmd /s /c "editor "my&file.txt""
cmd executes        "editor "my & file.txt""
                    (two commands, separated by `&')

Problem: cmd doesn't always strip *outer* quotes, but stops before `&'
Solution: make cmd's argument "atomic" by enclosing it in `('...`)'

Patch (by RoDo):
    shellcmdflag: /c    (no need to strip quotes)
    shellxquote: (      (and automatically use `)' at the end)

Yeah, this works now (also did without patch 7.4.443):
user executes       :!editor "my&file.txt"
vim executes        cmd /c (editor "my&file.txt")
cmd executes        (editor "my&file.txt")

------------------------------------------
Bug (with RoDo's patch)
    shellcmdflag: /c
    shellxquote: (

user executes       :!echo a & echo b
vim executes        cmd /c (echo a & echo b)
cmd executes        (echo a & echo b)
-> output: two lines, `a' and `b)'

Problem: echo does not ignore the trailing `)'
Solution: enclose cmd's argument in `"('...`)"'
          (I have no idea why this works)

Patch:
    shellcmdflag: /c    (not sure if `/s /c' would make a difference,
                        I'd expect `/c' to always remove outer quotes)
    shellxquote: "(
or maybe:
    shellxquote: "(,)"  (new syntax!)

Yeah, this works now (also did without patch 7.3.443):
user executes       :!echo a & echo b

--
Andy

--
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