emacs setup for both clojure and common lisp with slime-fancy (slime-autodoc)emacs setup for both clojure and common lisp with slime-fancy (slime-autodoc)
These are the steps I did to get this to work:, it's just what worked for me. All of the bits are under active development, so I think breakage in this area is pretty likely.
Edited to add:
If you find that Paredit in the SLIME REPL is broken while using this setup, check this out: http://www.emacswiki.org/emacs/ParEdit#toc3
At least one other potential issue with this is that, AFAICT, if you open a Common Lisp source file and then start SLIME, you won't be able to send forms from the first buffer to the SLIME buffer. So open a SLIME buffer before opening any Common Lisp source files, and it should work. This doesn't seem to apply to Clojure.
These are the steps I did to get this to work:
These are the steps I did to get this to work, it's just what worked for me. All of the bits are under active development, so I think breakage in this area is pretty likely.
Edited to add:
If you find that Paredit in the SLIME REPL is broken while using this setup, check this out: http://www.emacswiki.org/emacs/ParEdit#toc3
At least one other potential issue with this is that, AFAICT, if you open a Common Lisp source file and then start SLIME, you won't be able to send forms from the first buffer to the SLIME buffer. So open a SLIME buffer before opening any Common Lisp source files, and it should work. This doesn't seem to apply to Clojure.
DidThe following is what I did to get Common Lisp and Clojure to work in the same Emacs installation, along with the excellent emacs-starter-kit. This won't let you install SLIMEuse both at the same time (you have to restart Emacs to switch from ELPA?CL to Clojure or vice versa)
I believe that the version of SLIME in ELPA is old and, but works best for Clojure. For Common Lisp, you probably want to get the latestNewer version of SLIME from CVSwon't work for Clojure. I ran intoAdditionally, this problem last monthversion of SLIME seems to be stripped down (no swank-loader.el?) and won't work with Common Lisp.
If you don't wantThese are the steps I did to use Clojureget this to work:
With a fresh Emacs (no configuration at all, you can just uninstall SLIME fromso move anything .emacs somewhere else for the moment) install ELPA:
http://tromey.com/elpa/install.html
From within Emacs, install the packages "slime" and get"slime-repl". (M-x package-list-packages then C-s slime then i to select and x to install)
Move the files in ~/.emacs.d/elpa/slime-20100404 and ~/.emacs.d/elpa/slime-repl-20100404 to a new directory like ~/hacking/lisp/elpa-slime.
Throw out the ELPA install: $ rm -rf .emacs.d.
Now clone the emacs-starter-kit and move it to .emacs.d. I only did this with a fresh copy from technomancy's Github, so try that first if you have problems.
Get the latest SLIME with CVS:
cvs -d :pserver:anonymous:[email protected]:/project/slime/cvsroot co slime-cvs-slime If you don't have it, I don't think OS X comes with CVS installed, so you'll need to install CVSit from Macports, Homebrew or something else, as OS X doesn't come with it installed. Put the directory slime-cvs somewhere like your .emacs.d.
Then configure SLIME and your Common Lisp implementation in your .emacs or your customization file for the starter-kit:
(setq inferior-lisp-program "/usr/local/bin/sbcl") ; your Common Lisp impl (add-to-list 'load-path "~/.emacs.d/slime-cvs/") ; your SLIME from CVS directory (require 'slime) (slime-setup '(slime-repl)) You can then doI put Mcvs-x slime and this will start the CVS version of SLIME.
If you want to use both Common Lisp and Clojure with SLIME, and don't want to go fiddling around in your .emacs~/hacking/lisp every time you want to try something in a different language, set up two distinct versions of SLIME: the old one from ELPA and the newest one from CVS. I wrote two functions which set up SLIME and either connect to Common Lisp or Clojure. To change languages, you still have to restart Emacs, but you don't have to mess with dotfiles to switch from one language to another. It's a bit hackish but it sort of works. Let me know if someone has a better way!
(defun slime-common-lisp () (interactive) (setq inferior-lisp-program "/usr/local/bin/sbcl") ; your Common Lisp impl (add-to-list 'load-path "~/.emacs.dhacking/slime-lisp/cvs-slime/") ; your SLIME from CVS directory (require 'slime) (slime-setup '(slime-repl)) (slime)) (defun slime-clojure () (interactive) (add-to-list 'load-path "~/.emacs.dhacking/elpalisp/slimeelpa-20100404/"slime") (require 'slime) (slime-setup '(slime-repl)) (slime-connect "localhost" 4005)) Did you install SLIME from ELPA? I believe that the version in ELPA is old and works best for Clojure. For Common Lisp, you probably want to get the latest SLIME from CVS. I ran into this problem last month.
If you don't want to use Clojure at all, you can just uninstall SLIME from ELPA, and get the latest SLIME with CVS:
cvs -d :pserver:anonymous:[email protected]:/project/slime/cvsroot co slime-cvs If you don't have it, I think you'll need to install CVS from Macports, Homebrew or something else, as OS X doesn't come with it installed. Put the directory slime-cvs somewhere like your .emacs.d.
Then configure SLIME and your Common Lisp implementation in your .emacs or your customization file for the starter-kit:
(setq inferior-lisp-program "/usr/local/bin/sbcl") ; your Common Lisp impl (add-to-list 'load-path "~/.emacs.d/slime-cvs/") ; your SLIME from CVS directory (require 'slime) (slime-setup '(slime-repl)) You can then do M-x slime and this will start the CVS version of SLIME.
If you want to use both Common Lisp and Clojure with SLIME, and don't want to go fiddling around in your .emacs every time you want to try something in a different language, set up two distinct versions of SLIME: the old one from ELPA and the newest one from CVS. I wrote two functions which set up SLIME and either connect to Common Lisp or Clojure. To change languages, you still have to restart Emacs, but you don't have to mess with dotfiles to switch from one language to another. It's a bit hackish but it sort of works. Let me know if someone has a better way!
(defun slime-common-lisp () (interactive) (setq inferior-lisp-program "/usr/local/bin/sbcl") ; your Common Lisp impl (add-to-list 'load-path "~/.emacs.d/slime-cvs/") ; your SLIME from CVS directory (require 'slime) (slime-setup '(slime-repl)) (slime)) (defun slime-clojure () (interactive) (add-to-list 'load-path "~/.emacs.d/elpa/slime-20100404/") (require 'slime) (slime-setup '(slime-repl)) (slime-connect "localhost" 4005)) The following is what I did to get Common Lisp and Clojure to work in the same Emacs installation, along with the excellent emacs-starter-kit. This won't let you use both at the same time (you have to restart Emacs to switch from CL to Clojure or vice versa)
I believe that the version of SLIME in ELPA is old, but works for Clojure. Newer version of SLIME won't work for Clojure. Additionally, this version of SLIME seems to be stripped down (no swank-loader.el?) and won't work with Common Lisp.
These are the steps I did to get this to work:
With a fresh Emacs (no configuration at all, so move anything .emacs somewhere else for the moment) install ELPA:
http://tromey.com/elpa/install.html
From within Emacs, install the packages "slime" and "slime-repl". (M-x package-list-packages then C-s slime then i to select and x to install)
Move the files in ~/.emacs.d/elpa/slime-20100404 and ~/.emacs.d/elpa/slime-repl-20100404 to a new directory like ~/hacking/lisp/elpa-slime.
Throw out the ELPA install: $ rm -rf .emacs.d.
Now clone the emacs-starter-kit and move it to .emacs.d. I only did this with a fresh copy from technomancy's Github, so try that first if you have problems.
Get the latest SLIME with CVS:
cvs -d :pserver:anonymous:[email protected]:/project/slime/cvsroot co cvs-slime I don't think OS X comes with CVS installed, so you'll need to install it from Macports, Homebrew or something.
I put cvs-slime in ~/hacking/lisp.
(defun slime-common-lisp () (interactive) (setq inferior-lisp-program "/usr/local/bin/sbcl") ; your Common Lisp impl (add-to-list 'load-path "~/hacking/lisp/cvs-slime/") ; your SLIME from CVS directory (require 'slime) (slime-setup '(slime-repl)) (slime)) (defun slime-clojure () (interactive) (add-to-list 'load-path "~/hacking/lisp/elpa-slime") (require 'slime) (slime-setup '(slime-repl)) (slime-connect "localhost" 4005))