2.9 KiB
title | author | layout |
---|---|---|
Emacs and Other Schemes | Kevin McAllister | page |
I've done some additional playing with some Lisps and wanted to document the effort I went to set those up with emacs on my Mac OS X machine. Again I am using emacs installed with Homebrew and see below for using Geiser with Racket and Guile which are other programming language environments.
Geiser and Racket and Guile setup
I've seen fancy Clojure guys connect their emacs process to a REPL on a running JVM process. Using a bunch of technologies that I don't understand like Leiningen and Swank and SLIME.
Anyway I thought part of the LISP world was connecting to a running LISP REPL, so I did a little hunting and saw that Geiser seems to be a way to do that with a Scheme and it works with a modern language implementing a Scheme plus a whole lot more called Racket and another one called Guile. So I decided to try and set that up to and document the effort. This way when working through SICP I can use MIT/GNU Scheme for cannonical study, and Racket for fancy stuff™
-
Download and install Version 6.0 of Racket for Mac OS X 64 bit. Put the Racket directory under /Applications and rename it to remove the space.
-
Install Guile 2.0.9 because Geiser docs say it supports multiple REPLs
brew update brew install guile --devel
-
Install Geiser using it's ELPA package.
M-x package-install RET geiser RET
-
Update .emacs to tell geiser where Racket is, this line should go after the package system loading happens which will load geiser.
(setq geiser-racket-binary "/Applications/Racket/bin/racket")
-
Now I can run racket by doing
M-x run-racket
orM-x run-geiser RET racket RET
-
Or I can do Guile by doing
M-x run-guile
orM-x run-geiser RET guile RET
Connect to an already running Racket
-
Start Racket using this command so the search path includes the Racket server stuff in geiser.
racket -i -S "/Users/mcallist/.emacs.d/elpa/geiser-0.4/racket"
-
run this in your racket REPL:
(require geiser/server) (start-geiser 8000 "127.0.0.1")
-
In emacs run
M-x connect-to-racket RET localhost RET 8000 RET
Connect to an already running guile
-
Start guile using this commmand
guile --listen
-
In emacs
M-x connect-to-guile
and the default guile port is 37146
Currently this bombs out using guile 2.0.11 on my Mac using geiser-0.4. So I suspect some sort of conflict or mismatch, but I'm not troubleshooting it at the moment.