2

I'm trying use mit-scheme in emacs but I can't get passed that problem...

The problem is I don't know how to add white spaces in a file path in .emacs file So far I've tried

(setq scheme-program-name
"/Applications/MIT:GNU\ Scheme.app/Contents/Resources/mit-scheme")
(require 'xscheme)

and

(setq scheme-program-name
"/Applications/MIT:GNU Scheme.app/Contents/Resources/mit-scheme")
(require 'xscheme)

but the outputs I get is

Can't exec program: /Applications/MIT:GNUScheme.app/Contents/Resources/mit-scheme
Can't exec program: /Applications/MIT:GNU

because there is a white space missing in the path..

Felix D.
  • 2,180
  • 1
  • 23
  • 37
  • Double the backslash to insert a single literal backslash. This will then escape the space when you pass this string to a function that needs a path: "/Applications/MIT:GNU\\ Scheme.app/Contents/Resources/mit-scheme" – Tyler Dec 10 '13 at 21:43
  • the output I get is now Can't exec program: /Applications/MIT:GNU\ – Felix D. Dec 10 '13 at 21:46
  • Please provide some context - what function and/or variable are trying to use with this string? – Tyler Dec 10 '13 at 21:47
  • I just edited for more context! Sorry I didn't know it was important, I'm a total newbie with emacs stuff.. – Felix D. Dec 10 '13 at 21:50
  • Well, instead I used my alias in usr/bin/scheme* but if somebody has an answer I would be glad to hear it – Felix D. Dec 10 '13 at 22:00
  • Did you try without a backslash? In most cases you don't need a backslash when the path is provided as a string, as in this case. At least on Linux. Maybe it's different on Mac. – Tyler Dec 10 '13 at 22:02
  • Yes I did, and it didn't work either... – Felix D. Dec 10 '13 at 22:04

1 Answers1

2

I think this is not possible using the existing functions, due to the way scheme gets called. The function run-scheme contains an explicit call to the function split-string-and-unquote on the scheme program name. As a consequence, the path to the scheme program will always be split at the first space. This means it is impossible to use a path with a space in it.

This is a bug that should be reported to the maintainers I think.

Tyler
  • 9,872
  • 2
  • 33
  • 57
  • Well Stefan Monnier is one of my computer science teachers at Universite de Montreal, I'll tell him :P! Thanks for your help! – Felix D. Dec 10 '13 at 22:19