views:

449

answers:

1

can I use common lisp and Clojure from within emacs at the same time? I would like to have each lisp-REPL in its own buffer, and If i did this how could I controll which buffer sent its data to which lisp?

+16  A: 

Yes. In the documentation to Slime you will find slime-lisp-implementations. Here is how I have it defined in my .emacs:

(setq slime-lisp-implementations
   '((cmucl ("/usr/local/bin/lisp") :coding-system iso-8859-1-unix)
     (sbcl ("/usr/local/bin/sbcl" "--core" "/Users/pinochle/bin/sbcl.core-with-swank") :init (lambda (port-file _) (format "(swank:start-server %S :coding-system \"utf-8-unix\")\n" port-file)))
     (clozure ("/Users/pinochle/bin/ccl"))
     (clojure ("/Users/pinochle/bin/clojure") :init swank-clojure-init)))

You start up your lisps using M-- M-x Slime. It will ask you which Lisp to start up, and you use the name you defined in slime-lisp-implementations. In this example, I would use cmucl, sbcl, clozure or clojure.

You can switch the "active" REPL using the command C-c C-x c. For more info, see the Slime Documentation on controlling multiple connections.

Pinochle