aquamacs, slime and clojure on OS X

209 views
Skip to first unread message

Jake Penton

unread,
Sep 22, 2011, 8:46:19 PM9/22/11
to clo...@googlegroups.com
Sorry to raise something that has probably been asked and answered umpteen times. 

I have been looking forward to trying clojure for quite some time. I appreciate that clojure and its ecosystem is undergoing rapid development. However, I have spent the last day and a half trying to get either aquamacs or gnu emacs working with slime and clojure, with no success.

BTW, I have used aquamacs with slime and Common Lisp (ccl, sbcl) for a long time now. I know those are older, more stable languages, but good golly - I had aquamacs+slime+ccl set up in about an hour.

Is their a reliable set of instructions to set up slime with clojure somewhere?

I have followed instructions from a half dozen different web pages. They are rich in magic incantations which fail (possibly because I'm dense). I think I followed the instructions on the Getting Started with Emacs page linked to from the clojure site, but - it did not work. Perhaps my attitude is wrong, but the user comments on the Getting Started page basically demolished my confidence in the information there.

I won't post error messages yet, although it may come to that shortly.

I would prefer to use aquamacs, but would settle for GNU Emacs. What I want to start with is the simplest set of things that will give me a clojure REPL in aquamacs/emacs.

In the absence of reliable installation instructions (or perhaps even preferable to them), is there a description somewhere of the final target state that my system should be in? That is, I actually do NOT really want to use any of the following, unless absolutely required:
  • an Emacs Starter Kit
  • a development version of GNU Emacs, i.e. v.24
  • any kind of package manager for Emacs
  • any kind of project build system for clojure, i.e. leiningen
All of the above appear to me to be well-intended "help", any or all of which have broken on me as I tried this. Instead I would prefer to know what files I need in what locations. But then, who am I to boss y'all around on how to help me ;-)

My setup:
  • Snow Leopard 10.6.8
  • aquamacs 2.3a
  • GNU Emacs 24
  • clojure and clojure-contrib from macports, whatever their latest is
  • Slime-related jar files and elisp files littered all over the place that didn't do me any good

TIA.

- Jake -


Mark Rathwell

unread,
Sep 23, 2011, 11:31:14 AM9/23/11
to clo...@googlegroups.com
Intentionally avoiding leiningen on ideological grounds will make
things more difficult and frustrating for yourself. If you do want to
try it out, there are links below to get you started below. You can
realistically be up and running with emacs and slime in less than an
hour.

lein: https://github.com/technomancy/leiningen

lein tutorial:
https://github.com/technomancy/leiningen/blob/1.x/doc/TUTORIAL.md

swank-clojure: https://github.com/technomancy/swank-clojure

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

Phil Hagelberg

unread,
Sep 23, 2011, 12:20:38 PM9/23/11
to clo...@googlegroups.com
On Thu, Sep 22, 2011 at 5:46 PM, Jake Penton <jakep...@gmail.com> wrote:
> In the absence of reliable installation instructions (or perhaps even
> preferable to them), is there a description somewhere of the final target
> state that my system should be in? That is, I actually do NOT really want to
> use any of the following, unless absolutely required:
>
> an Emacs Starter Kit
> a development version of GNU Emacs, i.e. v.24
> any kind of package manager for Emacs
> any kind of project build system for clojure, i.e. leiningen

It's not really feasible to have a slime setup that's compatible with
both CL and Clojure without using Leiningen. The path of least
resistance is shown in the swank-clojure readme. The tl;dr version
follows:

* install Leiningen
* install the swank-clojure plugin: lein plugin install swank-clojure 1.3.2
* install clojure-mode (you can do this from git)
* navigate to a project and do M-x clojure-jack-in

That's all it takes. It might work with Aquamacs, but since that fork
is not portable it's impossible for me to test on it. So GNU Emacs is
recommended.

If you absolutely cannot use Leiningen then you will have to manually
juggle between the CL-compatible versions of slime packages and the
Clojure-compatible ones, which from what I've heard from CL users
sounds like a nightmare. (This is due to the fact that the Slime
developers only target CL and refuse to make stable releases.) If you
only need Clojure support then it's a little easier to get along
without Leiningen, but it's still a pain in the neck. But the
swank-clojure readme does explain embedding swank in your own
application. You just need to manually load the slime elisp files from
the swank-clojure git repository.

-Phil

Justin Kramer

unread,
Sep 23, 2011, 2:46:22 PM9/23/11
to clo...@googlegroups.com

  * install Leiningen
  * install the swank-clojure plugin: lein plugin install swank-clojure 1.3.2
  * install clojure-mode (you can do this from git)
  * navigate to a project and do M-x clojure-jack-in

That's all it takes. It might work with Aquamacs, but since that fork
is not portable it's impossible for me to test on it. So GNU Emacs is
recommended.

For what it's worth, I use this setup with Aquamacs and everything works perfectly.

Justin

MarisO

unread,
Sep 23, 2011, 7:05:12 PM9/23/11
to Clojure
use this script to download everything you need for clojure
development on emacs (aquamacs)

git clone https://github.com/technomancy/clojure-mode.git
wget -P framemove http://www.emacswiki.org/emacs/download/framemove.el
wget -P paredit http://mumble.net/~campbell/emacs/paredit.el
wget --no-check-certificate https://github.com/downloads/magit/magit/magit-1.0.0.tar.gz
mkdir magit
tar --strip-components=1 --directory=magit -xzf magit-1.0.0.tar.gz
wget http://download.savannah.gnu.org/releases/color-theme/color-theme-6.6.0.tar.gz
mkdir color-theme
tar --strip-components=1 --directory=color-theme -xzf color-
theme-6.6.0.tar.gz

my init.el:

;; clojure-mode
(add-to-list 'load-path "~/.emacs.d/clojure-mode")
(require 'clojure-mode)

;; paredit
(add-to-list 'load-path "~/.emacs.d/paredit")
(require 'paredit)

;; color theme
(add-to-list 'load-path "~/.emacs.d/color-theme")
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)))

; windmove and framemove
(add-to-list 'load-path "~/.emacs.d/framemove")
(require 'framemove)
(windmove-default-keybindings)
(setq framemove-hook-into-windmove t)

;; customizations
(menu-bar-mode -1)
(show-paren-mode t)
(if
(boundp 'tool-bar-mode)
(tool-bar-mode -1))
(if
(boundp 'scroll-bar-mode)
(scroll-bar-mode -1))

;; color profiles
(defun color-dark () (interactive)
(global-hl-line-mode 1)
(color-theme-deep-blue)
(set-face-foreground 'minibuffer-prompt "#9df0f6")
(set-face-background 'hl-line "#203e5e"))

;; shell fix
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

Durgesh Mankekar

unread,
Sep 23, 2011, 3:11:26 PM9/23/11
to clo...@googlegroups.com
+1 here. These instructions have worked for me with Aquamacs.

ngocdaothanh

unread,
Sep 25, 2011, 7:14:19 AM9/25/11
to Clojure
Coming from Eclipse, I can't live without the file browser.
I'm having this problem with ECB, please help:
http://stackoverflow.com/questions/7541693/ecb-context-menu-in-aquamacs

Thanks,
Ngoc

László Török

unread,
Sep 25, 2011, 11:52:46 AM9/25/11
to clo...@googlegroups.com
+1 for me too on Snow Leopard with latest Aquamacs

2011/9/23 Durgesh Mankekar <dur...@gmail.com>



--
László Török

Skype: laczoka2000
Twitter: @laczoka

George Kangas

unread,
Sep 25, 2011, 4:48:03 PM9/25/11
to Clojure
I'm quite happy using emacs's Scheme support. But then, I've never
experienced the luxury of swank and slime.

The Scheme modes work a bit better (for Clojure) than the Lisp modes,
because: 1) it highlights matching square and curly brackets, not just
parentheses; and 2) after you do "C-u M-x run-scheme" / java -cp..."
to start inferior "Scheme" mode, you can restart it with just "M-x run-
scheme" (within the same emacs session).

So, until you man up, and build the great edifice of leiningen + ant +
maven + ..., something I'll probably never get around to, you can make
do with Scheme mode. Good enough for the '90s!

Some people are happy with mini-IDE called "clooj" that's under
developement. You can find that on github.

ciao,

George

Roberto Mannai

unread,
Sep 25, 2011, 8:56:53 PM9/25/11
to clo...@googlegroups.com
I have some trouble. I'm on OSX Lion, and have a few hours ago
installed Aquamacs and SLIME from http://aquamacs.org/download.shtml.
Then installed lein/swank/and clojure-mode, as Phil suggested.

In order to make it work I had to remove the autodoc option, by
commenting line 20 from /Library/Application Support/Aquamacs
Emacs/SLIME/contrib/slime-fancy.el:
;(slime-autodoc-init)

So by starting swank manually with "lein swank" (or swank-clojure) +
M-x slime-connect I can now evaluate Clojure code in the REPL; instead
when doing a "clojure-jack-in" I get the following error:

(from *Messages* buffer)
<< Starting swank server...
<< error in process filter: progn: Invalid read syntax: ")"
<< error in process filter: Invalid read syntax: ")"

(last lines from *swank* buffer)
<< (provide 'slime-repl)
<< ;;; slime-repl.el ends here
<< (run-hooks 'slime-load-hook)

Any idea?

Jake Penton

unread,
Sep 29, 2011, 8:21:51 PM9/29/11
to clo...@googlegroups.com
Thanks for all the answers, everyone.

I did the original post and then immediately came down with some kind of nasty cold. So I just got back to it today, but have not had a chance to try the suggestions.

I'll probably discover that my setup difficulties had a lot to do with feeling crummy and being a bit fuzzy in the head. I'll find out shortly here.

Thanks again.

- J -

Jake Penton

unread,
Sep 29, 2011, 10:18:55 PM9/29/11
to clo...@googlegroups.com
Ok, I followed the simple instructions, but ran into a minor problem.

It seems that the Aquamacs version of slime conflicts with the clojure setup, and should be disabled. This version of slime (as delivered by the Aquamacs folks) is installed in /Library/Application Support/Aquamacs Emacs/SLIME/. Since I am not going to be using slime with Common Lisp for a while, I just deleted the afore-mentioned directory. There is no doubt a more subtle way, but for now I don't care.

My guess is that the majority of people using Aquamacs and clojure may not have had slime set up as I had for use with Common Lisp, so the conflict may not have been evident.

I now get a toplevel when I navigate to a leiningen project and do M-x clojure-jack-in, so HAPPY HAPPY HAPPY!

Thanks.

- J -


Roberto Mannai

unread,
Oct 24, 2011, 10:28:03 PM10/24/11
to clo...@googlegroups.com
Confirm, as Jake said it is enough to delete the folder
/Library/Application Support/Aquamacs Emacs/SLIME/; my problem was
probably derived from having previously installed also
Aquamacs-SLIME-2011-xxx.pkg.tgz, the SLIME plugin from
http://aquamacs.org/download.shtml.

(Lein's swank plugin uses an embedded slime.el - check
swank-clojure-1.4.0-SNAPSHOT.jar\swank\payload)

Reply all
Reply to author
Forward
0 new messages