On Mon, Nov 17, 2008 at 4:21 PM, Raffael Cavallaro
<raffaelc...@gmail.com> wrote:
> As the mention of Aquamacs in the title suggests, I'm on Mac OS X.
> I've read Bill Clementson's Blog on setting up clojure, and I'm not
> exactly a neophyte - I've been using slime with sbcl, openmcl, and
> other lisps for years.
>
> Nevertheless, even starting with an absolutely blank .emacs and
> freshly downloaded copies of Aquamacs, clojure, swank-clojure, and
> clojure-mode, the instructions in Bill's blog do not yield a working
> clojure under slime.
Unfortunately (or, fortunately, depending on your perspective),
Clojure is a moving target and an emacs/slime configuration that
worked one month ago will not necessarily work today.
> I've managed to get M-x run-lisp to work with the more basic of the
> two clojure modes out there, so Bill's shell script in and of itself
> is not the problem at all (it also works fine from a terminal window).
> However, I've never gotten slime to work, so somehow it doesn't play
> nice with swank-clojure and/or clojure-mode and/or slime.
>
> Is there anyone who would be willing to post an *actual* .emacs (not
> "add this line...," .emacs files involve clobbering globals, so order
> really does matter), and links to the *actual* versions of clojure,
> slime, swank-clojure, and clojure-mode that together, produce a
> functioning clojure under slime/Aquamacs?
>
> As a side note, I might suggest that links to a combination of ever-
> changing git repositories might not be the very best idea on a page
> entitled "Getting Started." IOW, it might be a good idea to take a
> known working combination of the above, zip them up and link to that
> instead.
Rather than ask someone to assemble a package and post it for you, it
is usually nicer (and a better learning experience) if you list
exactly what you did, and post the minimal config scripts that you
tried out and which illustrate what didn't work for you. However,
since I recently upgraded to the latest Clojure, I'll share what
worked for me:
0. Delete (or move away) any old versions of the following (e.g. don't
assume that something you downloaded a couple of days ago is ok to
use)
1. Download latest Clojure from svn: http://sourceforge.net/svn/?group_id=137961
2. Download latest clojure-mode & swank-clojure from git:
http://github.com/jochu/
3. Download latest slime from cvs: http://common-lisp.net/project/slime/
4. Download latest clojure-contrib from svn:
http://sourceforge.net/svn/?group_id=223136
5. Use ant to build clojure and clojure-contrib
6. Create a shell script (called "clojure") to launch clojure and put
it in your PATH :
#!/bin/sh -e
java -server -cp /Users/bc/lisp/clojure/clojure/trunk/clojure.jar:\
/Users/bc/lisp/clojure/clojure-contrib/trunk/clojure-contrib.jar:\
clojure.lang.Repl
7. Put the following minimal setup in your .emacs file (adjusting the
paths as necessary):
(setq load-path (append (list "/Users/bc/lisp/clbuild/source/slime"
"/Users/bc/lisp/clbuild/source/slime/contrib"
"/Users/bc/lisp/clojure/clojure-mode"
"/Users/bc/lisp/clojure/swank-clojure")
load-path))
(setq swank-clojure-binary "clojure")
(require 'clojure-auto)
(require 'swank-clojure-autoload)
(defun run-clojure ()
"Starts clojure in Slime"
(interactive)
(slime 'clojure))
(global-set-key [f5] 'run-clojure)
(global-set-key [(control f11)] 'slime-selector)
(add-hook 'slime-connected-hook 'slime-redirect-inferior-output)
8. Restart Aquamacs and press F5 - you should get a repl
The above worked for me when I re-installed Clojure (with the latest
AOT changes) a couple of days ago. If you have any problems with the
above, post a reply with any errors you encountered as well as any
differences in your setup.
--
Bill Clementson
> exactly what you did, and post the minimal config scripts that you the
On Nov 17, 8:43 pm, "Bill Clementson" <billc...@gmail.com> wrote:
>
> Rather than ask someone to assemble a package and post it for you, it
> is usually nicer (and a better learning experience) if you list
> tried out and which illustrate what didn't work for you.I think you miss the point here. I'm suggesting that all new users
would be much better served if clojure.org site cached a combination
of the necessary elements of a working slime install, not that someone
post something for me alone.
Allow me to repeat that I was using the latest git cloned and cvs co'd
On Nov 17, 11:55 pm, "Cosmin Stejerean" <cstejer...@gmail.com> wrote:
> Most of these projects change on a daily basis and so far I've never run
> into any issues using the latest version of each. During initial
> installation the chances of issues being due to user error are far greater
> than problems due to incompatible versions, and since getting in the habit
> of using the latest version (and updating regularly) is a good thing, I
> would recommend using the latest version to any newcomer and posting
> questions here including detailed explanation of what was tried and what
> happened.
versions of all these components , a *completely blank* .emacs, and a
freshly installed Aquamacs. IOW, a pristine, completely up to date
install. Just because it worked on the day you did your setup most
definitely does *not* mean this is a reliable procedure.
In some sense you can think of a cached stable install of some set of
developer tools as a performance optimization. In this case, the
performance being optimized is the developer's performance installing
a tool set.
Like any performance optimization, it should not be made prematurely.
Maybe the cost of managing the stable install outweighs the time
saved over developers just grabbing the various bits.
Your bad experience certainly suggests that it is time for a
prepackaged slime+clojure, --but--
> Remember the context: "Getting Started." The context is NOT bleeding
> edge developers who want the very latest build of everything. If you
> want the very latest slime, etc., you should be on your own.
If you are using Clojure you are somewhere in the neighborhood of the
bleeding edge. It isn't 1.0 yet.
I would love to see somebody step forward in the next few weeks and
announce a cached install that works. Then I could point to it in the
book before we go to print. :-)
Cheers,
Stuart
Maybe the "Getting Started" section of the wiki shouldn't point
beginners towards slime. Once someone is accustomed to using Clojure
with Emacs, they will appreciate the power of slime; however, to get
started, clojure-mode is more than sufficient. You should also
probably eliminate clojure-contrib and the separate clojure binary
from the "Getting Started" steps. The minimal steps to get started
with clojure and emacs then become:
1. Download latest Clojure from svn: http://sourceforge.net/svn/?group_id=137961
2. Download latest clojure-mode from git: http://github.com/jochu/
3. Use ant to build clojure
4. Put the following minimal setup in your .emacs file (adjusting the
paths as necessary):
(setq inferior-lisp-program "java -server -cp
/Users/bc/lisp/clojure/clojure/trunk/clojure.jar clojure.lang.Repl")
(pushnew "/Users/bc/lisp/clojure/clojure-mode" load-path
(require 'clojure-auto)
5. Restart Emacs. Load a clojure (clj) file in a buffer, press C-c C-z
to get a repl.
That is far simpler to get setup and the user can focus on clojure
rather than slime as they're getting started with the language.
--
Bill Clementson
All a new user would have to would be to download the exe, run it, and
choose emacs from their start menu. Everything would already be
configured to work with whatever version these tools were built
against. You could even install links to clojure
documentation/resource sites. (clojure.org, the wiki, the irc logs,
projecture, etc.)
I, of course, focus on Windows users because they are the people that
would most appreciate an all-in-one installer package. You could
easily create packages for OSX and distros of Linux.
This wouldn't help those that already have a running version emacs
that they're trying to set up, but that's what the other documentation
sites are for.
Does anyone have experience in creating windows installers like this?
I could look into it if people think it's a good idea, but I'm
inexperienced in these matters.
As a side note, those of you that are feeling the pain of keeping all
of these packages up to date, I highly recommend using MR[1]. All I
have to do is issue a `mr update` from my command line to pull in the
latest versions of all of these packages.
[1]: http://joey.kitenet.net/code/mr/
Daniel E. Renfer
You said that you followed my instructions; however, the protocol
version that prints out in the inferior-lisp buffer is "2008-11-23".
In my version of SLIME (which is several days old) the protocol
version that prints out in the inferior-lisp buffer is "2008-12-02".
If you have a swank-clojure from 07.12.2008, I suspect (at least) your
SLIME install is older than that. Therefore, I would suggest that you
repeat steps 1-5 (from my original email) to make certain you really
have compatible versions of each package.
- Bill