6

I use Aquamacs, and Aquamacs is pre-equipped with SLIME.

(setq inferior-lisp-program "/usr/local/bin/sbcl") #####!!!
(add-to-list 'load-path "/Library/Application Support/Aquamacs Emacs/SLIME/contrib")
(add-to-list 'load-path "/Library/Application Support/Aquamacs Emacs/SLIME")
(require 'slime)
(slime-setup)

As is asked in somewhere, I try to use Clojure by adding this code.

(add-to-list 'load-path "~/clojure/clojure-mode")
(setq inferior-lisp-program "/Users/smcho/bin/clj") ################
(require 'clojure-mode)
(setq auto-mode-alist
  (cons '("\\.clj$ . clojure-mode")
     auto-mode-alist))
(add-hook 'clojure-mode-hook
  '(lambda ()
     (define-key clojure-mode-map "\C-c\C-e" 'lisp-eval-last-sexp)))
)

I couldn't make it Clojure run with SLIME, but I'm satisfied with the current setting, the only problem is that because of the (setq inferior-lisp-program ...) code, I have to change the .emacs code depending on I use Clojure or SBCL.

Is there any way to solve this problem? Can I choose between multiple (inferior) Lisps?

Added

I could make Clojure run on Aquamacs. Please refer to Running Clojure with 'lein swank' on Aquamacs problem. Forget about the settings written above, if you want to run Aquamacs/Clojure. You need just one line, (slime-setup '(slime-repl)) and lein swank.

1
  • Added the Lisp tag so that Common Lisp SLIMErs might have a look; I'd expect them to be switching inferior^_superior Lisps much more often than the typical Clojurian. Commented Jul 27, 2010 at 4:54

1 Answer 1

5

Sure, you can use C-u M-x slime instead of just M-x slime to have SLIME ask you for the name of the Lisp executable to be launched, with whatever is your default already filled in.

There's also a slime-lisp-implementations variable which I have configured like so:

(setq slime-lisp-implementations
      `((clojure ,(swank-clojure-cmd) :init swank-clojure-init)
        (sbcl ("sbcl") :coding-system utf-8-unix)))

I have to say that I just can't remember what this does for me anymore (if indeed it does anything)... Type C-h v slime-lisp-implementations to learn roughly what it's supposed to do. I seem to have to type sbcl if I want to start that, which is fine by me due to the high Clojure-to-SBCL ratio in my SLIME'ing.

Update:

I have just rediscovered M-- M-x slime (that first key is meta-minus for a negative argument), which prompts for one of the names of Lisp implementations in slime-lisp-implementations (with tab completion) and then starts the required Lisp. With the above example config, M-- M-x slime sbcl starts SBCL.

(I find this useful mostly because of how it allows one to configure more complex commands to start Lisp -- e.g. (sbcl-options ("sbcl" "--an-option" "--another-option") ...), (sbcl-clbuild ("/path/to/clbuild" "lisp") ...) -- and refer to them by name.)

Sign up to request clarification or add additional context in comments.

1 Comment

By the way, at least the (clojure ...) entry is absolutely guaranteed to do nothing at all, since swank-clojure currently arranges to have it replaced just before the (Clojure) Swank server is started.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.