debuggingemacsclojureswankpallet

Clojure, emacs, ritz-swank: `M-x slime-connect` gives error message


I spent the afternoon trying to get the ritz-swank package to work with emacs and Clojure. (Googling the error message and much more gave no useful leads.) I hope somebody can give me some pointers that'll get me up and running.

The error is Symbol's value as variable is void: slime-ritz.

According to http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_142.html:

"If you have never given a symbol any value as a global variable, we say that that symbol's global value is void. In other words, the symbol's value cell does not have any Lisp object in it. If you try to evaluate the symbol, you get a void-variable error rather than a value.... A void variable does not have any value."

I tried to find the value of slime-ritz, using Emacs 'describe-variable' (C-h v), but it didn't return anything. Doing an appropos search on "ritz" turned up nothing, but searching for "slime" returned bunches of functions (so I assume that the slime package is present).

My installation procedure

I followed the instructions in the Install section of https://github.com/pallet/ritz/tree/develop/swank (the pallet/ritz project page), starting from scratch twice to make sure I was doing things right. Here is the sequence of my last attempt:

  1. Began with a system containing neither Emacs nor a ~/.emacs.d directory.

  2. Installed Emacs 24.2, the latest available Mac OS X version (from http://emacsformacosx.com/)

  3. Installed Emacs Prelude through a curl command (see http://batsov.com/prelude/)

  4. Downloaded (as the project page said to) specific versions of slime and slime-ritz

  5. Installed both of them manually using M-x package-install-file

  6. Exited and relaunched emacs, just in case....

  7. Installed lein-ritz as per the page's instructions and successfully got:

    Greggs-Mac-Pro:combolock gr$ lein ritz user=> Swank server listening on local port 51521

  8. M-x slime-connect (which is supposed to make the connection from Emacs to the Swank server) returned the error Symbol's value as variable is void: slime-ritz in the Emacs minibuffer.

Diagnostic data

Running M-x package-activated-list produced the following list of loaded packages:

(ace-jump-mode ack-and-a-half elisp-slime-nav exec-path-from-shell expand-region flycheck gist gh guru-mode helm-projectile helm logito magithub magit melpa paredit pcache projectile dash rainbow-delimiters rainbow-mode s slime slime-ritz solarized-theme undo-tree volatile-highlights yasnippet zenburn-theme)

Running M-x package-list-packages listed the following packages as installed:

ace-jump-mode      20121104....
ack-and-a-half     20130204....
dash               20130223....
elisp-slime-nav    20130127....
exec-path-from-... 20121108.945
expand-region      20130223....
flycheck           20130223....
gh                 20121231.208
gist               20121231.212
guru-mode          20121016....
helm               20130223....
helm-projectile    20130131....
logito             20120225....
magit              20130222....
magithub           20121130....
melpa              20120202....
paredit            20110508....
pcache             20120408....
projectile         20130220....
rainbow-delimiters 20120428.45 
rainbow-mode       0.6         
s                  20130216....
slime              20101113.1   <-- manually installed, from sources
slime-ritz         0.6.0        <--  specified by pallet/ritz page
solarized-theme    20130215....
undo-tree          20130119.926
volatile-highli... 20120215.9  
yasnippet          20130218....
zenburn-theme      20130215....

I noticed that clojure-mode wasn't present, so I added that, but step 8, above, gave the same error message.

Some shot-in-the-dark questions

1) Do I need to install pallet?

2) Do I need to install any other package from the ritz family (https://github.com/pallet/ritz)?

I'm really looking forward to using ritz-swank--it looks really powerful! (Thanks to Hugo Duncan for all the hard work!)


Solution

  • Emacs Predule ships nrepl.el instead of swank-clojure. You need to install nrepl-ritz instead of swank-ritz. Swank-clojure is a dead project, that's no longer supported in clojure-mode 2.0.0 (the one that comes with Predule).