[ANN] Radically simplified Emacs and SLIME setup

1,087 views
Skip to first unread message

Phil Hagelberg

unread,
May 17, 2011, 11:41:29 PM5/17/11
to clo...@googlegroups.com
I pushed out some changes last night that make it much, much easier to
get set up with Emacs and SLIME. If you've tried it and ended up
bewildered by issues with ELPA or how to launch a swank server, give
it another go! It only takes three steps to get started:

1. Install clojure-mode via git or marmalade-repo.org
2. lein plugin install swank-clojure 1.3.1
3. Invoke M-x clojure-jack-in from a project

More details along with a short screencast are on my blog:
http://technomancy.us/149 60 seconds from zero config to running
SLIME!

-Phil

Ambrose Bonnaire-Sergeant

unread,
May 17, 2011, 11:46:00 PM5/17/11
to clo...@googlegroups.com
As a VimClojure user, the big problem I have with SLIME is the installation process!

Great stuff, looking forward to trying it out.

Ambrose

Tassilo Horn

unread,
May 19, 2011, 2:39:27 AM5/19/11
to clo...@googlegroups.com
Phil Hagelberg <ph...@hagelb.org> writes:

Hi Phil,

> I pushed out some changes last night that make it much, much easier to
> get set up with Emacs and SLIME. If you've tried it and ended up
> bewildered by issues with ELPA or how to launch a swank server, give
> it another go! It only takes three steps to get started:
>
> 1. Install clojure-mode via git or marmalade-repo.org
> 2. lein plugin install swank-clojure 1.3.1
> 3. Invoke M-x clojure-jack-in from a project

I tried it by first deinstalling any clojure/swank/SLIME packages I
had. Then I installed clojure-mode 1.9.0 from the marmalade-repo.

In a terminal, I did

$ lein upgrade # ==> 0.6.3
$ lein plugin install swank-clojure 1.4.0-SNAPSHOT

Then I opened some clojure file in an existing project and did

M-x clojure-jack-in RET

I got a new popup *swank* buffer, but in there, I get an exception.

--8<---------------cut here---------------start------------->8---
;;; Bootstrapping bundled version of SLIME; please wait...

;;; slime.el --- Superior Lisp Interaction Mode for Emacs
;;
;;;; License
;; Copyright (C) 2003 Eric Marsden, Luke Gorrie, Helmut Eller
;; Copyright (C) 2004,2005,2006 Luke Gorrie, Helmut Eller
;; Copyright (C) 2007,2008,2009 Helmut Eller, Tobias C. Rittweiler

[...]

(provide 'slime-repl)
;;; slime-repl.el ends here

(run-hooks 'slime-load-hook)
Warning: *classpath* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *classpath* or change the name.
Reflection warning, swank/util/io.clj:15 - call to java.lang.String ctor can't be resolved.
[... snipped more reflection warnings ...]
Reflection warning, swank/swank.clj:76 - call to java.lang.Integer ctor can't be resolved.
Exception in thread "main" java.lang.IllegalArgumentException: No value supplied for key: 55298
at clojure.lang.PersistentHashMap.createWithCheck(PersistentHashMap.java:89)
at clojure.core$hash_map.doInvoke(core.clj:355)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:600)
at swank.swank$start_server.doInvoke(swank.clj:56)
at clojure.lang.RestFn.invoke(RestFn.java:516)
at user$eval1615.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6378)
at clojure.lang.Compiler.eval(Compiler.java:6368)
at clojure.lang.Compiler.eval(Compiler.java:6369)
at clojure.lang.Compiler.eval(Compiler.java:6345)
at clojure.core$eval.invoke(core.clj:2745)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$null_opt.invoke(main.clj:348)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:405)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
--8<---------------cut here---------------end--------------->8---

I have to say that this project uses a clojure 1.3.0 snapshot. Is that
supposed to work? And if not, is there some workaround?

Bye,
Tassilo

Paul Mooser

unread,
May 19, 2011, 1:29:06 PM5/19/11
to Clojure
I had a similar issue with an existing project - it went away when I
created a new project and did "lein deps".

On May 18, 11:39 pm, Tassilo Horn <tass...@member.fsf.org> wrote:
> Exception in thread "main" java.lang.IllegalArgumentException: No value supplied for key: 55298
>

Phil Hagelberg

unread,
May 19, 2011, 7:30:54 PM5/19/11
to Clojure
On May 18, 11:39 pm, Tassilo Horn <tass...@member.fsf.org> wrote:
> I tried it by first deinstalling any clojure/swank/SLIME packages I
> had.  Then I installed clojure-mode 1.9.0 from the marmalade-repo.
>
> In a terminal, I did
>
>   $ lein upgrade        # ==> 0.6.3
>   $ lein plugin install swank-clojure 1.4.0-SNAPSHOT

There is no Leiningen version 0.6.3--I'm assuming you're running
1.5.2?

> Then I opened some clojure file in an existing project and did
>
>   M-x clojure-jack-in RET
>
> I got a new popup *swank* buffer, but in there, I get an exception.
> Warning: *classpath* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *classpath* or change the name.
> Reflection warning, swank/util/io.clj:15 - call to java.lang.String ctor can't be resolved.

It looks like there are still problems with suppressing output from
the subprocess. I'll see if I can get that fixed soon.

> I have to say that this project uses a clojure 1.3.0 snapshot.  Is that
> supposed to work?  And if not, is there some workaround?

If you upgrade to leiningen from git it will remove the *classpath*
warning, but if you have other output like reflection warnings it's
not going to work right now unless you can get rid of it all; sorry.
Hopefully I'll have a fix soon.

-Phil

Tassilo Horn

unread,
May 20, 2011, 2:15:53 AM5/20/11
to clo...@googlegroups.com
Phil Hagelberg <ph...@hagelb.org> writes:

Hi Phil,

>>   $ lein upgrade        # ==> 0.6.3


>>   $ lein plugin install swank-clojure 1.4.0-SNAPSHOT
>
> There is no Leiningen version 0.6.3--I'm assuming you're running
> 1.5.2?

Ups, you are correct. ;-)

>> Reflection warning, swank/util/io.clj:15 - call to java.lang.String
>> ctor can't be resolved.
>
> It looks like there are still problems with suppressing output from
> the subprocess. I'll see if I can get that fixed soon.
>
>> I have to say that this project uses a clojure 1.3.0 snapshot.  Is that
>> supposed to work?  And if not, is there some workaround?
>
> If you upgrade to leiningen from git it will remove the *classpath*
> warning, but if you have other output like reflection warnings it's
> not going to work right now unless you can get rid of it all; sorry.
> Hopefully I'll have a fix soon.

Do I get you right that the output is the problem that prevents me to
get to the SLIME REPL, since you didn't say anything at all about that
IllegalArgumentException?

Bye,
Tassilo

Phil Hagelberg

unread,
May 20, 2011, 7:06:01 PM5/20/11
to Clojure
On May 19, 11:15 pm, Tassilo Horn <tass...@member.fsf.org> wrote:
> Do I get you right that the output is the problem that prevents me to
> get to the SLIME REPL, since you didn't say anything at all about that
> IllegalArgumentException?

I'm not sure what's going on with the IllegalArgumentException. Do you
have more than one version of swank in ~/.lein/plugins? If so it's due
to a separate bug in Leiningen. But I've fixed the output bug in
clojure-mode 1.9.1; see if that helps.

-Phil

Tom Hicks

unread,
May 21, 2011, 8:41:18 PM5/21/11
to Clojure
Where does one get clojure-mode 1.9.1? The latest I see on github is
1.7.1.

Benny Tsai

unread,
May 21, 2011, 8:51:12 PM5/21/11
to clo...@googlegroups.com
You can grab it here:

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


On Saturday, May 21, 2011 6:41:18 PM UTC-6, Tom Hicks wrote:
Where does one get clojure-mode 1.9.1? The latest I see on github is
1.7.1.

On May 20, 4:06 pm, Phil Hagelberg <p....@hagelb.org> wrote:

Tom Hicks

unread,
May 21, 2011, 9:34:23 PM5/21/11
to Clojure
Thanks Benny! That was the problem and the new simplified setup
just worked for me. -t

Tassilo Horn

unread,
May 22, 2011, 5:34:51 AM5/22/11
to clo...@googlegroups.com
Phil Hagelberg <ph...@hagelb.org> writes:

Hi Phil,

>> Do I get you right that the output is the problem that prevents me to


>> get to the SLIME REPL, since you didn't say anything at all about
>> that IllegalArgumentException?
>
> I'm not sure what's going on with the IllegalArgumentException. Do you
> have more than one version of swank in ~/.lein/plugins?

No, but there were three versions of leiningen in ~/.lein/self-installs/
if that matters.

> If so it's due to a separate bug in Leiningen. But I've fixed the
> output bug in clojure-mode 1.9.1; see if that helps.

No, still I get

--8<---------------cut here---------------start------------->8---
Exception in thread "main" java.lang.IllegalArgumentException: No value supplied for key: 52572


at clojure.lang.PersistentHashMap.createWithCheck(PersistentHashMap.java:89)
at clojure.core$hash_map.doInvoke(core.clj:355)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:600)
at swank.swank$start_server.doInvoke(swank.clj:56)
at clojure.lang.RestFn.invoke(RestFn.java:516)
at user$eval1615.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6378)
at clojure.lang.Compiler.eval(Compiler.java:6368)
at clojure.lang.Compiler.eval(Compiler.java:6369)
at clojure.lang.Compiler.eval(Compiler.java:6345)
at clojure.core$eval.invoke(core.clj:2745)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$null_opt.invoke(main.clj:348)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:405)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
--8<---------------cut here---------------end--------------->8---

But with a new project created with "lein new myproject" it works fine.
Even after changing that new project's deps to clojure 1.3.0-SNAPSHOT.

Hm, I wonder what's making the existing project not "jack-innable"...

Bye,
Tassilo

Phil Hagelberg

unread,
May 24, 2011, 12:32:10 PM5/24/11
to Clojure
On May 22, 2:34 am, Tassilo Horn <tass...@member.fsf.org> wrote:
> But with a new project created with "lein new myproject" it works fine.
> Even after changing that new project's deps to clojure 1.3.0-SNAPSHOT.
>
> Hm, I wonder what's making the existing project not "jack-innable"...

I think this may be due to a conflict between swank in ~/.lein/plugins
and swank in lib/dev. I'm not sure what we could do about this since
they all need to be on the classpath. Perhaps a warning could be
issued.

-Phil

Tassilo Horn

unread,
May 24, 2011, 2:59:44 PM5/24/11
to clo...@googlegroups.com
Phil Hagelberg <ph...@hagelb.org> writes:

Hi Phil,

>> But with a new project created with "lein new myproject" it works


>> fine. Even after changing that new project's deps to clojure
>> 1.3.0-SNAPSHOT.
>>
>> Hm, I wonder what's making the existing project not "jack-innable"...
>
> I think this may be due to a conflict between swank in ~/.lein/plugins
> and swank in lib/dev.

Oh, indeed. The project had 1.3.0 while in ~/.lein/plugins/ it was a
1.4.0 snapshot. I changed my project.clj to require 1.4.0-SNAPSHOT, did
run "lein deps force", and now it works. Thank you!

Bye,
Tassilo

J.R. Garcia

unread,
May 24, 2011, 4:28:40 PM5/24/11
to Clojure
*Note: I'm an emacs n00b!

I'm having an issue when running clojure-jack-in. I followed the steps
in the video and once I get to the point of using clojure-jack-in I
get: "Symbol's function definition is void: locate-dominating-file". I
am running GNU Emacs 22.1.1 (mac-apple-darwin) if that matters. I'll
try following along on with Emacs.app and Aquamacs and see if that
changes anything.

Thanks,

J.R. Garcia

On May 24, 1:59 pm, Tassilo Horn <tass...@member.fsf.org> wrote:

J.R. Garcia

unread,
May 24, 2011, 4:32:21 PM5/24/11
to Clojure
Following along in a version of Emacs.app compiled from source works
just fine. It may just be a problem with version 22.1.1 (which is
admittedly pretty old). prefer to run inside of iTerm2, but I can
update emacs.

Phil Hagelberg

unread,
May 24, 2011, 7:55:09 PM5/24/11
to Clojure
On May 24, 1:28 pm, "J.R. Garcia" <mrjohngar...@gmail.com> wrote:
> I'm having an issue when running clojure-jack-in. I followed the steps
> in the video and once I get to the point of using clojure-jack-in I
> get: "Symbol's function definition is void: locate-dominating-file". I
> am running GNU Emacs 22.1.1 (mac-apple-darwin) if that matters. I'll
> try following along on with Emacs.app and Aquamacs and see if that
> changes anything.

Yeah, sorry--22 is quite old (~4 years?) and no longer supported. I
should make that clearer in the docs.

-Phil

J.R. Garcia

unread,
May 26, 2011, 11:37:09 PM5/26/11
to Clojure
I compiled a new version of emacs from source and started it up.
clojure-jack-in just worked flawlessly. This is stupid simple! Thanks
for your hard work! It's much appreciated for emacs newcomers like me
(I'm a vim user)!

Thanks again,
J.R. Garcia

Wolodja Wentland

unread,
May 27, 2011, 6:31:00 AM5/27/11
to Clojure
On Thu, May 26, 2011 at 20:37 -0700, J.R. Garcia wrote:
> I compiled a new version of emacs from source and started it up.
> clojure-jack-in just worked flawlessly. This is stupid simple! Thanks
> for your hard work! It's much appreciated for emacs newcomers like me
> (I'm a vim user)!

I am curious: Why don't you use the excellent vimclojure plugin for vim?

If you decide to do so, I would also recommend the paredit implementation in
the slimv plugin.
--
.''`. Wolodja Wentland <bab...@gmail.com>
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC

signature.asc

Ambrose Bonnaire-Sergeant

unread,
May 27, 2011, 6:52:04 AM5/27/11
to clo...@googlegroups.com
On Fri, May 27, 2011 at 6:31 PM, Wolodja Wentland <bab...@gmail.com> wrote:
On Thu, May 26, 2011 at 20:37 -0700, J.R. Garcia wrote:
> I compiled a new version of emacs from source and started it up.
> clojure-jack-in just worked flawlessly. This is stupid simple! Thanks
> for your hard work! It's much appreciated for emacs newcomers like me
> (I'm a vim user)!

I am curious: Why don't you use the excellent vimclojure plugin for vim?

If you decide to do so, I would also recommend the paredit implementation in
the slimv plugin.

On that note, has anyone tried using Hugo Duncan's Slime debugger via slimv?


I have no idea if this is possible, I've only recently tried slimv.

Ambrose

Mark Engelberg

unread,
May 29, 2011, 10:53:23 PM5/29/11
to clo...@googlegroups.com
I need more details about how to install the current version of
clojure-mode. When I do alt-x package-install and type clojure-mode I
get a bunch of messages that it is compiling clojure-mode 1.7.1.

The website said to install clojure-mode via marmalade, but it's not
at all clear to me what marmalade actually does (the website for
marmalade gives brief instructions about how to install marmalade, but
nothing about how to use it to install something else).

Thanks in advance,

Mark

László Török

unread,
May 30, 2011, 1:06:21 AM5/30/11
to clo...@googlegroups.com

Heh, yeah that marmelade was a funny one, I spent a few hours figuring what goes where.....

I suggest you download emacs-starter-kit from Phil's github repo, that has the necessary configuration for marmelade too.

Then proceed with installing clojure-mode.

Las

sent from my mobile device

> --
> 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

Mark Engelberg

unread,
May 30, 2011, 1:50:59 AM5/30/11
to clo...@googlegroups.com
On Sun, May 29, 2011 at 10:06 PM, László Török <ltor...@gmail.com> wrote:
> Heh, yeah that marmelade was a funny one, I spent a few hours figuring what
> goes where.....
>
> I suggest you download emacs-starter-kit from Phil's github repo, that has
> the necessary configuration for marmelade too.
>
> Then proceed with installing clojure-mode.

I did all that once (downloading Phil's emacs-starter-kit) a long time
ago. I just can't seem to get it all to download the newest version
of clojure-mode. For example, when I do package-list-packages it
still shows 1.7.1. Any pointers?

Thanks,

Mark

László Török

unread,
May 30, 2011, 2:24:28 AM5/30/11
to clo...@googlegroups.com
Then you might wanna double check whether you have the latest version (of emacs-starter-kit), as it worked for me with a week old snapshot. (Im on Mac, running Aquamacs).

2011/5/30 Mark Engelberg <mark.en...@gmail.com>

Mark

--
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



--
László Török

Skype: laczoka2000
Twitter: @laczoka

Mark Engelberg

unread,
May 30, 2011, 2:26:50 PM5/30/11
to clo...@googlegroups.com
Has anyone tried this on Windows?

I reinstalled emacs-starter-kit, then reinstalled clojure-mode. I
downloaded the latest version of lein, and created a completely fresh
new project. Then, I did lein plugin install swank-clojure 1.3.1.
I opened up the core.clj from the newly created project in emacs and
did clojure-jack-in.

I get the error: The system cannot find the path specified.

Thanks,

Mark

Phil Hagelberg

unread,
May 30, 2011, 5:25:03 PM5/30/11
to Clojure
On May 30, 11:26 am, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> Has anyone tried this on Windows?

I actually just got a bug report a few days ago with a fix for Windows
compatibility. I just pushed out a 1.9.2 release that includes that
fix. So if you M-x package-install clojure-mode again you should pull
it in. He said he was having the same "cannot find the path specified"
problem that you mentioned, so hopefully this will take care of the
issue you were seeing.

> The website said to install clojure-mode via marmalade, but it's not
> at all clear to me what marmalade actually does

Marmalade is a community package source like Clojars. So now rather
than email new versions of packages to the ELPA maintainer and wait a
few weeks for them to be uploaded, I can upload them myself, and they
are immediately available.

For future reference it's not necessary to pull in a whole new copy of
the Starter Kit to use it; it's just a matter of upgrading to the
latest package.el (http://bit.ly/pkg-el23) and adding Marmalade as a
source as directed at http://marmalade-repo.org. Older versions of
package.el were hard-coded to point to ELPA only, which is probably
why you were only seeing the outdated versions.

-Phil

Mark Engelberg

unread,
May 30, 2011, 6:10:20 PM5/30/11
to clo...@googlegroups.com
The package installer saw the 1.9.2 release, which I installed. I'm
still getting the "cannot find the path specified" error though.

Thanks for all the help you all have provided so far; let me know if
you have any other ideas for me to try.

Thanks,

Mark

J.R. Garcia

unread,
May 30, 2011, 10:16:33 PM5/30/11
to Clojure
Having worked with Lisp in the path, I didn't get that "interactive"
feel with VimClojure. I didn't really enjoy using Nailgun either. That
being said, VimClojure is certainly a great plugin. I also have been
wanting to get used to the keybindings for emacs because of my daily
work. I have to use Visual Studio 2008 daily and it has emacs
keybindings built-in. I don't really want to have to pay $99 for ViEmu
and VsVim is only for Visual Studio 2010. Anyway, it isn't that
VimClojure was bad, emacs is just the best fit for me right now.

On May 27, 5:31 am, Wolodja Wentland <babi...@gmail.com> wrote:
> On Thu, May 26, 2011 at 20:37 -0700, J.R. Garcia wrote:
> > I compiled a new version of emacs from source and started it up.
> > clojure-jack-in just worked flawlessly. This is stupid simple! Thanks
> > for your hard work! It's much appreciated for emacs newcomers like me
> > (I'm a vim user)!
>
> I am curious: Why don't you use the excellent vimclojure plugin for vim?
>
> If you decide to do so, I would also recommend the paredit implementation in
> the slimv plugin.
> --
>   .''`.     Wolodja Wentland    <babi...@gmail.com>
>  : :'  :
>  `. `'`     4096R/CAF14EFC
>    `-       081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC
>
>  signature.asc
> < 1KViewDownload

Joop Kiefte

unread,
May 30, 2011, 10:18:46 PM5/30/11
to clo...@googlegroups.com
And Emacs has Viper-mode (and other Vi-keybinding-stuff) :)

2011/5/30 J.R. Garcia <mrjohn...@gmail.com>:

Matjaz Gregoric

unread,
May 31, 2011, 8:54:59 AM5/31/11
to clo...@googlegroups.com
Indeed, I switched from Vim to Emacs with Viper and Vimpulse and so far it has been a very pleasant experience, giving me best of both worlds.

Mark Engelberg

unread,
Jun 8, 2011, 8:36:11 PM6/8/11
to clo...@googlegroups.com
It's been a couple of weeks, so I thought I'd check in and see whether
anyone has yet been successful at using the new clojure-jack-in
process on Windows. Did the 1.9.2 release successfully resolve the
"cannot find the path specified" error for anyone else?

Thanks,

Mark

Andreas Liljeqvist

unread,
Jun 9, 2011, 4:18:02 AM6/9/11
to clo...@googlegroups.com
One week ago on windows.
install latest stable Emacs.
install Emacs starter kit.
M-x package-install clojure-mode

lein plugin install swank-clojure 1.3.1
Be sure to remove any old swank-clojure from your plugin dir.

invoke M-x clojure-jack-in from a project

Works for me atleast.

Phil - Thanks for all the great work.




2011/6/9 Mark Engelberg <mark.en...@gmail.com>

Mark Engelberg

unread,
Jun 9, 2011, 4:22:11 AM6/9/11
to clo...@googlegroups.com
Andreas, can you clarify exactly where you got emacs from? I got it from here:
http://ftp.gnu.org/gnu/emacs/windows/

Is there another/better source?

Andreas Liljeqvist

unread,
Jun 9, 2011, 5:17:40 AM6/9/11
to clo...@googlegroups.com
http://ftp.gnu.org/gnu/emacs/windows/emacs-23.3-bin-i386.zip

Just tested a clean installation at work. No problems.

Remove your .emacs.d/ just to be sure.

Is there anything more to your error message than "cannot find the path specified"?

I am using windows 7 btw.


2011/6/9 Mark Engelberg <mark.en...@gmail.com>

Bhinderwala, Shoeb

unread,
Jun 9, 2011, 5:52:06 AM6/9/11
to clo...@googlegroups.com
Thanks Phil for the good work.

Emacs v23 didn't work for me in either Windows XP or Windows 7.

So, I searched and found Emacs 24 at:

http://code.google.com/p/emacs-for-windows/updates/list

clojure-jack-in with Emacs 24 worked seamlessly with Windows 7 (64 bit).

With Windows XP, clojure-jack-in fails with the following error:

"cd c:/projects/pasclj && lein jack-in 11991: exited abnormally with code 1."

So, on XP I start "lein swank" manually in another window and use slime-connect.

Shoeb

Jeff Dik

unread,
Jun 9, 2011, 11:20:52 AM6/9/11
to clo...@googlegroups.com
On Wed, Jun 8, 2011 at 8:36 PM, Mark Engelberg <mark.en...@gmail.com> wrote:
> It's been a couple of weeks, so I thought I'd check in and see whether
> anyone has yet been successful at using the new clojure-jack-in
> process on Windows.  Did the 1.9.2 release successfully resolve the
> "cannot find the path specified" error for anyone else?

With clojure-mode 1.9.2 and (GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
of 2009-07-30 on SOFT-MJASON) (according to emacs-version), I had to
change a s-exp on line 848 in clojure-mode.el from

(expand-file-name clojure-root)

to

(replace-regexp-in-string "/" "\\\\" (expand-file-name clojure-root) t)

and that resolved the "cannot find the path specified" error for me.

Many thanks to Phil & all for their work on this!

Hope that helps,
Jeff

>
> Thanks,
>
> Mark
>
> On Mon, May 30, 2011 at 3:10 PM, Mark Engelberg
> <mark.en...@gmail.com> wrote:
>> The package installer saw the 1.9.2 release, which I installed.  I'm
>> still getting the "cannot find the path specified" error though.
>>
>> Thanks for all the help you all have provided so far; let me know if
>> you have any other ideas for me to try.
>>
>> Thanks,
>>
>> Mark
>>
>

Mark Engelberg

unread,
Jun 9, 2011, 8:47:37 PM6/9/11
to clo...@googlegroups.com
OK, I just tried a totally clean install of emacs 24 (I had been using
emacs 23.1), first deleting my existing .emacs.d directory and tried
to do the absolute minimum that the instructions specified. I added
the marmalade package repository to my .emacs file. I installed
clojure-mode and clojure-test-mode and absolutely nothing else. I set
up a new lein project with lein plugin install swank-clojure 1.3.1.

I still get the error.

On Thu, Jun 9, 2011 at 2:17 AM, Andreas Liljeqvist <bon...@gmail.com> wrote:
> Is there anything more to your error message than "cannot find the path
> specified"?

At the bottom, it says:
cd c:/Devel/Clojure/lein/testalpha7/ && lein jack-in 1187: exited
abnormally with code 1.

Thanks for all the help. I'm looking forward to getting this working.

Mark Engelberg

unread,
Jun 9, 2011, 9:14:31 PM6/9/11
to clo...@googlegroups.com
On Thu, Jun 9, 2011 at 8:20 AM, Jeff Dik <s45...@gmail.com> wrote:
> With clojure-mode 1.9.2 and (GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
> of 2009-07-30 on SOFT-MJASON) (according to emacs-version), I had to
> change a s-exp on line 848 in clojure-mode.el from
>
>    (expand-file-name clojure-root)
>
> to
>
>    (replace-regexp-in-string "/" "\\\\" (expand-file-name clojure-root) t)
>
> and that resolved the "cannot find the path specified" error for me.

This worked for me! I recommend this magical change be rolled into
any future version of clojure-mode.

Thanks!

Phil Hagelberg

unread,
Jun 10, 2011, 11:46:20 PM6/10/11
to Clojure
On Jun 9, 6:14 pm, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> On Thu, Jun 9, 2011 at 8:20 AM, Jeff Dik <s45...@gmail.com> wrote:
> > I had to change a s-exp on line 848 in clojure-mode.el from
>
> >    (expand-file-name clojure-root)
>
> > to
>
> >    (replace-regexp-in-string "/" "\\\\" (expand-file-name clojure-root) t)
>
> > and that resolved the "cannot find the path specified" error for me.

Wow, that looks an awful lot like a bug in Emacs to me. expand-file-
name really should return paths that work with the host OS.

> This worked for me!  I recommend this magical change be rolled into
> any future version of clojure-mode.

I can't really do that as it's flagrantly nonportable. However, it may
be that we can just rely on Leiningen to find the project root
instead. Does this work?

(defun clojure-jack-in ()
(interactive)
;; graaaahhhh--no closures in elisp (23)
(setq clojure-swank-port (+ 1024 (* (random 64512))))
(shell-command (format clojure-swank-command clojure-swank-port)
"*swank*")
(set-process-filter (get-buffer-process "*swank*")
(lambda (process output)
(with-current-buffer "*swank*"
(insert output))
(when (string-match "proceed to jack in"
output)
(with-current-buffer "*swank*"
(kill-region (save-excursion
(goto-char (point-max))
(search-backward "slime-
load-hook")
(forward-line)
(point))
(point-max)))
(eval-buffer "*swank*")
(slime-connect "localhost" clojure-swank-
port)
(set-process-filter process nil))))
(message "Starting swank server..."))

-Phil

Mark Engelberg

unread,
Jun 12, 2011, 1:56:10 PM6/12/11
to clo...@googlegroups.com
On Fri, Jun 10, 2011 at 8:46 PM, Phil Hagelberg <ph...@hagelb.org> wrote:
> I can't really do that as it's flagrantly nonportable. However, it may
> be that we can just rely on Leiningen to find the project root
> instead. Does this work?

Seems to work for me.

Mark Engelberg

unread,
Jun 12, 2011, 1:58:26 PM6/12/11
to clo...@googlegroups.com
I take that back (I had edited the wrong file, which wasn't the one my
emacs was using).

I get the error "Not enough arguments for format string".

Phil Hagelberg

unread,
Jun 12, 2011, 7:51:09 PM6/12/11
to Clojure
On Jun 12, 10:58 am, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> I take that back (I had edited the wrong file, which wasn't the one my
> emacs was using).
>
> I get the error "Not enough arguments for format string".

Oops; I forgot to mention it also needs this:

(defvar clojure-swank-command "lein jack-in %s &")

to replace the old clojure-swank-command defvar.

-Phil

Sean Corfield

unread,
Jun 12, 2011, 8:44:45 PM6/12/11
to clo...@googlegroups.com
On Sun, Jun 12, 2011 at 4:51 PM, Phil Hagelberg <ph...@hagelb.org> wrote:
> (defvar clojure-swank-command "lein jack-in %s &")

Just curious: why defvar over plain def there? (I'm thinking in the
context of defvar being in the old deprecated contrib libraries and
not being in the new maintained contrib libraries)
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

Mark Engelberg

unread,
Jun 12, 2011, 8:50:05 PM6/12/11
to clo...@googlegroups.com
error in process filter: Search failed: "slime-load-hook"

Phil Hagelberg

unread,
Jun 13, 2011, 12:27:27 AM6/13/11
to Clojure
On Jun 12, 5:44 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
> On Sun, Jun 12, 2011 at 4:51 PM, Phil Hagelberg <p...@hagelb.org> wrote:
> > (defvar clojure-swank-command "lein jack-in %s &")
>
> Just curious: why defvar over plain def there? (I'm thinking in the
> context of defvar being in the old deprecated contrib libraries and
> not being in the new maintained contrib libraries)

Oh, heh... well yes, but this is elisp. =)

-Phil

Jeff Dik

unread,
Jun 17, 2011, 4:32:00 PM6/17/11
to clo...@googlegroups.com
Phil,

This works for me! Thanks!

Jeff

Jeff Dik

unread,
Jun 17, 2011, 4:35:10 PM6/17/11
to clo...@googlegroups.com
Mark,

I got this same error when I copied and pasted the clojure-jack-in
function from gmail. I had to remove newlines from

(search-backward "slime-load-hook")

and

(slime-connect "localhost" clojure-swank-port)

Hope that helps,
Jeff

gaz jones

unread,
Jun 23, 2011, 11:20:44 AM6/23/11
to clo...@googlegroups.com
this is really great, thanks for putting this together.

i have a (possibly daft) question -- is there a neat way to
kill/restart the underlying process. i have looked for a *ahem*
clojure-jack-off function or equivalent but couldnt find one in the
source. i am just killing it from the terminal at the moment and
re-running clojure-jack-in... is there a better way? slime-disconnect
seems to leave the underlying process still running in list-processes.

thanks again!

gaz

Sam Ritchie

unread,
Jun 23, 2011, 11:24:28 AM6/23/11
to clo...@googlegroups.com
This should do the trick, though I'm not set up with jack-in to test:

At the REPL, type comma (the character ,), then sayoonara.

gaz jones

unread,
Jun 23, 2011, 11:47:20 AM6/23/11
to clo...@googlegroups.com
awesome, it works. many thanks :D i clearly need to read the slime manual

Phil Hagelberg

unread,
Jun 23, 2011, 12:16:35 PM6/23/11
to clo...@googlegroups.com
Sam Ritchie <sritc...@gmail.com> writes:

> This should do the trick, though I'm not set up with jack-in to test:
>
> At the REPL, type comma (the character ,), then sayoonara.

You can also just kill the *swank* buffer.

-Phil

Reply all
Reply to author
Forward
0 new messages