ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Riobard <yaogzhan@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: t-vim module quoting problem on OS X
Date: Sun, 23 May 2010 20:17:31 +0200	[thread overview]
Message-ID: <AANLkTineHa3ItU8AhYYXaqg9oCSGsd8btJXkOg-t1Jsl@mail.gmail.com> (raw)

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
___________________________________________________________________________________


                 reply	other threads:[~2010-05-23 18:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTineHa3ItU8AhYYXaqg9oCSGsd8btJXkOg-t1Jsl@mail.gmail.com \
    --to=yaogzhan@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).