Search code examples
emacslispcommon-lispslime

load external with emacs-slime


I'd like to install slime on my Emacs 23.2.1. Since M-x slime doesn't succeed in start it, I modified the ~/.emacs file.

(setq inferior-lisp-program "/usr/bin/sbcl")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
(require 'slime)
(slime-setup)

Of course this doesn't work for the slime path in the second line of ~/.emacs file should be /usr/share/common-lisp/source/swank instead. However, after I changed this directory, the error remains. It says like this:

Couldn't load "/usr/share/emacs/site-lisp/slime/swank-loader.lisp": file does not exist.

Why would this load external remain and how to make these things right?


Solution

  • This post on LispForum suggests adding the following line to your .emacs:

    (slime-setup '(slime-fancy))
    

    The explanation for the error:

    What you are seeing is an effect of splitting REPL into a contrib. No contribs are loaded by default, which is a bit unfortunate, since current bare slime has pretty minimal functionality.

    Edit: OK, what platform, Emacs, and Slime version are you using? I'm using Emacs 24 on Ubuntu. I installed slime using apt-get. I was seeing the same error as you:

    Couldn't load "/usr/share/emacs/site-lisp/slime/swank-loader.lisp": file does not exist.
    

    I fixed it using the method suggested in this answer:

    The next thing to try is M-x customize-variable slime-backend and setting that to the absolute path of swank-loader.lisp. I think that will fix it for sure, but I am not sure why it doesn't work to begin with.

    I had to customize the value of slime-backend to /usr/share/common-lisp/source/slime/swank-loader.lisp to get M-x slime to work.