SLIME on Windows 7
Asked Answered
S

1

6

I'm trying to get set up with SLIME on a Windows 7 box, but running M-x slime gives me the error

Spawning child process: invalid argument

I have inferior-lisp-program set to "C:\\Program Files\\ccl\\wx86cl.exe" (which is factually correct, and running (comint-run inferior-lisp-program) gives me a working CCL prompt), and the slime directory added to my 'load-path.

What am I doing wrong?

EDIT: Tried loading up the same environment through the Windows edition of lispbox, and it runs SLIME fine. I'd prefer not to use that one because it packages an older Emacs, CCL and SLIME than I want.

Sacristan answered 25/7, 2013 at 14:24 Comment(8)
Do you get any extra useful information when activating debug-on-error before doing M-x slime?Allocution
@Allocution - Nope. Same error, even after (setf debug-on-error t). If I hadn't checked the validity of my inferior-lisp-program first, I'd say slime was failing to find it.Sacristan
Strange. I would try to debug slime-maybe-start-lisp (maybe looking for differences with arguments passed here in relation to the ones passed to lispbox's SLIME). But that basically means that I am clueless :-)Allocution
SLIME questions are best asked on its mailing list. common-lisp.net/project/slime/#mailinglistSimplicidentate
What if... maybe you need to escape the space in Program Files? This error would happen if you have malformed command to send to the shell. It doesn't look like SLIME is sending any more options with the command, so that's the only one I can think of. Also, you'd be much better off adding the location of your lisp to the PATH, or symlinking it somewhere on exec-path, if system-wide settings are impossible / undesirable.Kenny
@wvxvw - I have no idea why, but that was it. It wasn't enough to escape the space, by the way, I had to move my ccl folder out of Program Files into a location where no part of the path contains a space. Wanna put that up as an answer?Sacristan
Oh, cool :) Well, Program Files is known to create a lot of problems in the file locating business :) So taking that out of the equation is always a good thing.Kenny
Great tip, I set mine to C:\\Progra~1\\Steelb~1\\1.2.1\\sbcl.exe and it works like a charm.Cosme
K
10

The message you received means that there's a high chance that there was a syntax problem with the command given to shell. This would be caused by having characters in the file name, which can be interpreted as doing something special. So, it looks like Emacs was trying to call C:\\Program "program" with an argument Files\\ccl\\wx86cl.exe.

There are several ways to address the error:

  • There has to be an escaping function, something like:

(shell-quote-argument "C:\\Program Files\\ccl\\wx86cl.exe")

But since you cannot affect how the file name is passed to the function which creates the process, this isn't going to work.

  • You can move the program you want to call to a directory with "safe" name.

  • You can move the executable to be on the system path (%PATH% variable in Windows) - through changing environment variables and appending the directory with the executable to it.

  • One more option is to add the directory with the executable to exec-path variable in Emacs. This variable holds a list of all directories looked up for programs to run, if you just call a program by name, rather then by full path. This also (at least for me) makes my .emacs file easier to port between different systems.

Kenny answered 25/7, 2013 at 20:21 Comment(3)
I followed the last option. (setq inferior-lisp-program "sbcl.exe") I did not need to setup my exec-path at all. sblc.exe is installed in the default location of C:\Program Files (x86)\Steel Bank Common Lisp\1.3.1Zeta
Whoa, this was driving me crazy. I started it already outside of emacs with sbcl, because it was on my path, but I still wrote the full path as parameter. Definitely one thing to remember that emacs is running as a user process, too.Bayles
This was a huge help. I tested both adding sbcl.exe to a safe directory and do the system path and both worked.Ignominy

© 2022 - 2024 — McMap. All rights reserved.