質問

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.

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top