On Fri, 10 Apr 2009, Andy wrote:
Does
mtxrun --verbose --noquotes bin:vim "-u NONE"
work correctly on windows?
Yes.
What about if you run "texexec --lua" instead of "context" (with noquote changed to noquotes in t-vim.tex)?
Same problem. The log shows:
MTXrun | MTXrun | executing: vim "-u NONE -e -C -n -c set" "tabstop=8 -c syntax" "on -c set" "syntax=c -c let" "contextstartline=1 -c let" "contextstopline=0 -c source" "c:/context/tex/texmf-context/tex/context/third/vim/2context.vim -c wqa vimdemo-vimsyntax.tmp " MTXrun | MTXrun |
You can see from above that the argument of vim command -c is not correctly quoted. As mentioned in my last email, the \runvimsyntax generates an incorrect vim command. For example, we expect the line in \runvimsyntax
The generated command is correct. mtxrun messes up the quotes.
-c \shellescapedquote syntax on\shellescapedquote\space
Will be: -c "syntax on" in the vim command line. However, the log shows it become to: -c syntax " " on. I think that is one problem cause the failure.
I also tried type the command manually:
vim -u None -e -C -n -c "set tabstop=8" -c "syntax on" -c "set syntax=c" -c "let contextstartline=1" -c "let contextstopline=0" -c "source c:/context/tex/texmf-context/tex/context/third/vim/2context.vim" -c "wqa" "vimdemo-vimsyntax.tmp"
It works. File named "vimdemo-vimsyntax.tmp-vimsyntax.tmp" generated. Next time run texexec will get the correct pdf output.
Another found is if tried mtxrun as:
mtxrun --verbose --noquotes bin:vim "-u None -e -C -n -V10log -c \"set tabstop=8\" -c \"syntax on\" -c \"set syntax=c\" -c \"let contextstartline=1\" -c \"let contextstopline=0\" -c \"source c:/context/tex/texmf-context/tex/context/third/vim/2context.vim\" -c \"wqa\" \"vimdemo-vimsyntax.tmp\" "
or
mtxrun --verbose --noquotes bin:vim -u None -e -C -n -V10log -c "set tabstop=8" -c "syntax on" -c "set syntax=c" -c "let contextstartline=1" -c "let contextstopline=0" -c "source c:/context/tex/texmf-context/tex/context/third/vim/2context.vim" -c "wqa" "vimdemo-vimsyntax.tmp" "
No vimdemo-vimsyntax.tmp-vimsyntax.tmp generated. The vim log says that it: could not source "None"
It should be -u NONE (all capitals)
It seems the vim may not received the -c "source ..." and other parameters. So I move the vim command to a batch file: vimcmd.bat with following line,
call vim -u None -e -C -n -c "set tabstop=8" -c "syntax on" -c "set syntax=c" -c "let contextstartline=1" -c "let contextstopline=0" -c "source c:/context/tex/texmf-context/tex/context/third/vim/2context.vim" %*
then call
mtxrun --verbose --noquotes bin:vimcmd -c "wqa" "vimdemo-vimsyntax.tmp" or mtxrun --verbose --noquotes bin:vimcmd "-c \"wqa\" \"vimdemo-vimsyntax.tmp\" "
It works well.
Great.
I haven't linux/unix machine on hand so I didn't know if this problem is only occurred in windows. Or the mtxrun related?
It is mtxrun related. It works in linux, so it could be windows related. I do not have a windows machine to test (and not enough diskspace to install windows on a VM). As a last resort, what does the log file say for this (all in one line) mtxrun --verbose --noquotes bin:vim "-u NONE -e -C -n -V10log -c \"set tabstop=8\" -c \"syntax on\" -c \"set syntax=c\" -c \"let contextstartline=1\" -c \"let contextstopline=0\" -c \"source c:/context/tex/texmf-context/tex/context/third/vim/2context.vim\" -c \"wqa\" \"vimdemo-vimsyntax.tmp\" " If this does not work, does replacing bin:vim with bin:gvim work? Aditya