ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* fixing mpiv on installation path with spaces
@ 2012-05-15 23:45 Mojca Miklavec
  2012-05-16  7:15 ` Hans Hagen
  2012-05-16  7:51 ` Hans Hagen
  0 siblings, 2 replies; 3+ messages in thread
From: Mojca Miklavec @ 2012-05-15 23:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

last year Taco added many patches to make sure that ConTeXt works even
when installed to "C:\Documents and Settings\ ..." and other weird
paths with spaces. However metapost in mkiv still fails. I figured out
that the following patch (which *won't* handle paths with quotation
marks properly) in mlib-run.lua fixes the problem:

    local preamble = [[
        boolean mplib ; mplib := true ;
        let dump = endinput ;
-        input %s ;
+        input "%s" ;
    ]]

but I'm not sure if there are any other side effects or if there are
other places that also need a patch. I didn't test with filenames with
spaces or with filenames with weird characters that need escaping.
Maybe it would be helpful to pass
    file.addsuffix(name,"mp")
through additional filter (instead of simply adding quotation marks)
that would also check if any other character needs escaping and add
quotation marks if needed.

Minimal example:
- install ConTeXt into path with spaces
- test with context on
    \starttext
    \startMPcode
    draw fullcircle scaled 3cm;
    \stopMPcode
    \stoptext

I would be grateful if somebody could take a look, so that a fix could
make it into TL 2012.

Thanks,
    Mojca
___________________________________________________________________________________
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] 3+ messages in thread

* Re: fixing mpiv on installation path with spaces
  2012-05-15 23:45 fixing mpiv on installation path with spaces Mojca Miklavec
@ 2012-05-16  7:15 ` Hans Hagen
  2012-05-16  7:51 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2012-05-16  7:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Taco Hoekwater, Mojca Miklavec

On 16-5-2012 01:45, Mojca Miklavec wrote:
> Hello,
>
> last year Taco added many patches to make sure that ConTeXt works even
> when installed to "C:\Documents and Settings\ ..." and other weird
> paths with spaces. However metapost in mkiv still fails. I figured out
> that the following patch (which *won't* handle paths with quotation
> marks properly) in mlib-run.lua fixes the problem:
>
>      local preamble = [[
>          boolean mplib ; mplib := true ;
>          let dump = endinput ;
> -        input %s ;
> +        input "%s" ;
>      ]]

I'm always a it puzzled by mp's file name handling as the name is not 
really a string. MP oracle Taco has to speak up ...

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 3+ messages in thread

* Re: fixing mpiv on installation path with spaces
  2012-05-15 23:45 fixing mpiv on installation path with spaces Mojca Miklavec
  2012-05-16  7:15 ` Hans Hagen
@ 2012-05-16  7:51 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2012-05-16  7:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec

On 16-5-2012 01:45, Mojca Miklavec wrote:

> Maybe it would be helpful to pass
>      file.addsuffix(name,"mp")
> through additional filter (instead of simply adding quotation marks)
> that would also check if any other character needs escaping and add
> quotation marks if needed.

let's for the moment just add the quotes .. using " in a tex tds path is 
not that clever anyway and this piece of mp code only deals with loading 
the format which always is located in a sane path

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2012-05-16  7:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 23:45 fixing mpiv on installation path with spaces Mojca Miklavec
2012-05-16  7:15 ` Hans Hagen
2012-05-16  7:51 ` Hans Hagen

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