ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* t-vim module quoting problem on OS X
@ 2010-05-23 18:17 Riobard
  0 siblings, 0 replies; only message in thread
From: Riobard @ 2010-05-23 18:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

t-vim.tex has a very strange quoting issue when it tries to invoke
vim. Here is the piece of code that causes problem:

----------------------
\def\runvimsyntax#1
   {\executesystemcommand
      {mtxrun --verbose --noquote bin:vim
          "-u NONE  % No need to read unnessary configurations
           -e       % run in ex mode
           -C       % Set compatibile
           -n       % No swap
%          -V10log  % For debugging only, will go away later.
           -c \shellescapedquote set tabstop=\@@vstab
\shellescapedquote\space
           -c \shellescapedquote syntax on\shellescapedquote\space
           -c \shellescapedquote set syntax=\@@vssyntax\shellescapedquote\space
           -c \shellescapedquote let
contextstartline=\@@vsstart\shellescapedquote\space
           -c \shellescapedquote let
contextstopline=\@@vsstop\shellescapedquote  \space
           -c \shellescapedquote source
kpse:2context.vim\shellescapedquote\space
           -c \shellescapedquote wqa\shellescapedquote\space
            \shellescapedquote#1\shellescapedquote\space " }}
-------------------------

On OS X (10.6) Vim complains:

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 10 2010 21:54:21)
Garbage after option argument: "-u NONE -e -C -n -c "set tabstop=8" -c
"syntax on" -c "set syntax=scala" -c "let contextstartline=1" -c "let
contextstopline=0" -c "source
/Users/rio/ConTeXt/tex/texmf-context/tex/context/third/vim/2context.vim"
-c "wqa" "usecase-vimsyntax.tmp" "
More info with: "vim -h"

I searched the mailing list and found an old thread where Mojca talked
about the rare strange quoting behavior. So I changed the above code
to

--------------------------
\def\runvimsyntax#1
   {\executesystemcommand
      {mtxrun --verbose --noquote bin:vim
           -u NONE  % No need to read unnessary configurations
           -e       % run in ex mode
           -C       % Set compatibile
           -n       % No swap
%          -V10log  % For debugging only, will go away later.
           -c "set tabstop=\@@vstab"
           -c "syntax on"
           -c "set syntax=\@@vssyntax"
           -c "let contextstartline=\@@vsstart"
           -c "let contextstopline=\@@vsstop"
           -c "source kpse:2context.vim"
           -c "wqa"
            "#1"}}
-----------------------------

and it works on OS X. Not sure if it will work on other platforms. Can
someone try it out on Windows and Linux please? What's the proper way
to do quoting in a crossplatform manner in ConTeXt?




- Rio
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-23 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-23 18:17 t-vim module quoting problem on OS X Riobard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).