[ANN] swank-clojure 1.3.4 released

196 views
Skip to first unread message

Phil Hagelberg

unread,
Dec 27, 2011, 8:03:19 PM12/27/11
to clo...@googlegroups.com

I just pushed out version 1.3.4 of Swank Clojure.

The main feature in this release is Derek Mansen's work integrating
clj-stacktrace into the debugger frames, so now you can get stack traces
with alignment and colorization. I'm very excited about this release
since it's a significant usability improvement: http://imgur.com/fD3rA

I should note that this is on a separate branch from the CDT debugger,
but the next step now that 1.3.4 is out is to merge it back into the
CDT-aware master branch, which should see a release soon after the
underlying CDT library is released.

-Phil

Baishampayan Ghose

unread,
Dec 28, 2011, 4:47:56 AM12/28/11
to clo...@googlegroups.com
On Wed, Dec 28, 2011 at 6:33 AM, Phil Hagelberg <ph...@hagelb.org> wrote:
> I just pushed out version 1.3.4 of Swank Clojure.

Does it work with Clojure 1.2? What exclusions do I need for that in
my project.clj?

Regards,
BG

--
Baishampayan Ghose
b.ghose at gmail.com

Gert Verhoog

unread,
Dec 28, 2011, 6:33:02 AM12/28/11
to clo...@googlegroups.com
On 28/12/2011, at 2:03 PM, Phil Hagelberg wrote:

> I just pushed out version 1.3.4 of Swank Clojure.

Great stuff, thanks! I ran into the problem with an older clj-stacktrace jar as you describe in the documentation, because I'm including [ring "1.0.1"] in my project.clj, which uses clj-stacktrace 0.2.2 instead of 0.2.4. Since ring is a fairly popular piece of software it might be worth considering mentioning this in your documentation (in addition to the note about incanter and an older clj-stacktrace)? I changed my ring dependencies in project.clj into this, which works:

[clj-stacktrace "0.2.4"]
[ring "1.0.1" :exclusions [clj-stacktrace]]

cheers,
gert

Phil Hagelberg

unread,
Dec 28, 2011, 4:37:05 PM12/28/11
to clo...@googlegroups.com
Gert Verhoog <m...@gertalot.com> writes:

> On 28/12/2011, at 2:03 PM, Phil Hagelberg wrote:
>> I just pushed out version 1.3.4 of Swank Clojure.
>
> Great stuff, thanks! I ran into the problem with an older
> clj-stacktrace jar as you describe in the documentation, because I'm
> including [ring "1.0.1"] in my project.clj, which uses clj-stacktrace
> 0.2.2 instead of 0.2.4.

This is actually already mentioned, but I'll try to make it clearer. Do
you think this is good?

> Since swank-clojure 1.3.4, having versions of clj-stacktrace older
> than 0.2.4 in your project or user-level plugins will cause `Unable to
> resolve symbol: pst-elem-str` errors. Keep in mind that user-level
> plugins in `~/.lein/plugins` are uberjars in Leiningen 1.x, so it's
> possible that one of your plugins (such as `lein-difftest` before
> version 1.3.7) contains an old clj-stacktrace even if it doesn't have
> its own file there. Specifying a newer version should be enough if
> you're having trouble:
>
> :dependencies [[clj-stacktrace "0.2.4"]]

The :exclusions line shouldn't be necessary.

-Phil

Phil Hagelberg

unread,
Dec 28, 2011, 4:37:55 PM12/28/11
to clo...@googlegroups.com
Baishampayan Ghose <b.g...@gmail.com> writes:

> On Wed, Dec 28, 2011 at 6:33 AM, Phil Hagelberg <ph...@hagelb.org> wrote:
>> I just pushed out version 1.3.4 of Swank Clojure.
>
> Does it work with Clojure 1.2? What exclusions do I need for that in
> my project.clj?

I'm not aware of any issues with using Swank Clojure in 1.2. If you're
having trouble please post details.

-Phil

Takahiro

unread,
Dec 28, 2011, 9:43:45 PM12/28/11
to clo...@googlegroups.com
Hi,
I don't get colored stacktrace.
http://imgur.com/5NCEW
Is any procedure needed?
I've tried 1.3.4 with clojure 1.2.1/1.3.0 and Emacs 23.3.
My .emacs.el includes only load-path and marmalade settings.

>> including [ring "1.0.1"] in my project.clj, which uses clj-stacktrace
>> 0.2.2 instead of 0.2.4.
> This is actually already mentioned, but I'll try to make it clearer. Do
> you think this is good?

I think ring should specify dependency using version range like below.
[clj-stacktrace "[0.2.2,)"] ;; 0.2.2 <= x

http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution
I didn't know it until recently, but now I think wherever possible
every library should specify version with it.

Thanks.

2011/12/29 Phil Hagelberg <ph...@hagelb.org>:

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

Sean Corfield

unread,
Dec 28, 2011, 10:38:59 PM12/28/11
to clo...@googlegroups.com
On Wed, Dec 28, 2011 at 6:43 PM, Takahiro <fat...@googlemail.com> wrote:
> I think ring should specify dependency using version range like below.
> [clj-stacktrace "[0.2.2,)"] ;; 0.2.2 <= x
>
> http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution
> I didn't know it until recently, but now I think wherever possible
> every library should specify version with it.

The only problem is when a future version of a dependency introduces a
breaking change (which happens quite a lot with relatively new
libraries).
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

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

Keith Irwin

unread,
Dec 29, 2011, 12:13:23 AM12/29/11
to clo...@googlegroups.com
Hi--

The only way I could get the colorized stack-trace was to use M-x clojure-jack-in.

Normally, I type "lein swank" on a command line, then use M-x slime-connect from Emacs. This is so that I can see the clojure.tools.logging output. (I've no idea where it goes when you use clojure-jack-in.

I'm also using emacs 24 and clojure-mode 1.11.5.


Takahiro

unread,
Dec 29, 2011, 2:11:02 AM12/29/11
to clo...@googlegroups.com
Hi Sean,
> The only problem is when a future version of a dependency introduces a> breaking change (which happens quite a lot with relatively new> libraries).You are right. hmm which we should choose might be bepend on which attitude is conservative or progressive.

Keith> The only way I could get the colorized stack-trace was to use M-x
> clojure-jack-in.


> I'm also using emacs 24 and clojure-mode 1.11.5.

I switched emacs to 24 and get the same results.
Thanks!

2011/12/29 Sean Corfield <seanco...@gmail.com>:

Baishampayan Ghose

unread,
Dec 29, 2011, 5:04:40 AM12/29/11
to clo...@googlegroups.com
On Thu, Dec 29, 2011 at 3:07 AM, Phil Hagelberg <ph...@hagelb.org> wrote:
>> On Wed, Dec 28, 2011 at 6:33 AM, Phil Hagelberg <ph...@hagelb.org> wrote:
>>> I just pushed out version 1.3.4 of Swank Clojure.
>>
>> Does it work with Clojure 1.2? What exclusions do I need for that in
>> my project.clj?
>
> I'm not aware of any issues with using Swank Clojure in 1.2. If you're
> having trouble please post details.

It does work fine on 1.2.1 with the aforementioned exclusion for ring.

However, I don't see the colored stacktraces yet. Does that need any
extra config? I am starting the swank server externally using `lein
swank`. It doesn't work even when I `jack-in` from Emacs.

Pavel Exarkhopoulo

unread,
Dec 29, 2011, 2:11:34 PM12/29/11
to clo...@googlegroups.com
> after the underlying CDT library is released.

1.2.6.2-SNAPSHOT is in clojars, but does anyone happen to know when the cdt github repo is to be updated? or has the project moved?

Thanks!

Alasdair MacLeod

unread,
Dec 30, 2011, 12:12:56 PM12/30/11
to Clojure
On Dec 28, 1:03 am, Phil Hagelberg <p...@hagelb.org> wrote:
> I just pushed out version 1.3.4 of Swank Clojure.
>
I see the fix for windows file name separators has gone in.
clojure-jack-in now works on my windows laptop.

Many thanks, Alasdair

Phil Hagelberg

unread,
Jan 1, 2012, 4:53:29 PM1/1/12
to clo...@googlegroups.com
Takahiro <fat...@googlemail.com> writes:

> http://imgur.com/5NCEW
> Is any procedure needed?
> I've tried 1.3.4 with clojure 1.2.1/1.3.0 and Emacs 23.3.
> My .emacs.el includes only load-path and marmalade settings.
>
>>> including [ring "1.0.1"] in my project.clj, which uses clj-stacktrace
>>> 0.2.2 instead of 0.2.4.
>> This is actually already mentioned, but I'll try to make it clearer. Do
>> you think this is good?
> I think ring should specify dependency using version range like below.
> [clj-stacktrace "[0.2.2,)"] ;; 0.2.2 <= x
>
> http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution
> I didn't know it until recently, but now I think wherever possible
> every library should specify version with it.

There are lots of problems with version ranges, but this would be a bad
idea for Ring specifically because it would allow backwards-incompatible
versions to be pulled in when a new breaking clj-stacktrace version is
released. Specifying a range with an upper bound is slightly better, but
it will prevent ring from working with newer versions that are
compatible but don't exist at the time of ring's release since ranged
version numbers are absolute and Maven will refuse to resolve two
non-overlapping ranges in the same build.

I used to think more people should use version ranges, but I recently
discovered these issues and now recommend against their use entirely.

-Phil

Phil Hagelberg

unread,
Jan 2, 2012, 7:52:17 PM1/2/12
to clo...@googlegroups.com
Keith Irwin <keith...@gmail.com> writes:

> The only way I could get the colorized stack-trace was to use M-x
> clojure-jack-in.
>
> Normally, I type "lein swank" on a command line, then use M-x
> slime-connect from Emacs. This is so that I can see the
> clojure.tools.logging output. (I've no idea where it goes when you use
> clojure-jack-in.

Getting colors outside M-x clojure-jack-in requires a couple extra steps
I forgot to document, I just added it here:

https://github.com/technomancy/swank-clojure/commit/94fa71f90e52c55d74

-Phil

Baishampayan Ghose

unread,
Jan 3, 2012, 12:28:48 AM1/3/12
to clo...@googlegroups.com
> Getting colors outside M-x clojure-jack-in requires a couple extra steps
> I forgot to document, I just added it here:
>
> https://github.com/technomancy/swank-clojure/commit/94fa71f90e52c55d74

Thanks, the above steps worked--almost. I now see the raw ANSI color
escape codes and not the colors. How do I tell Emacs to interpret the
color codes the right way?

Cedric Greevey

unread,
Jan 3, 2012, 12:40:02 AM1/3/12
to clo...@googlegroups.com
On Tue, Jan 3, 2012 at 12:28 AM, Baishampayan Ghose <b.g...@gmail.com> wrote:
>> Getting colors outside M-x clojure-jack-in requires a couple extra steps
>> I forgot to document, I just added it here:
>>
>> https://github.com/technomancy/swank-clojure/commit/94fa71f90e52c55d74
>
> Thanks, the above steps worked--almost. I now see the raw ANSI color
> escape codes and not the colors. How do I tell Emacs to interpret the
> color codes the right way?

My preferred method would involve 'rm /user/bin/emacs', but maybe
that's just me. ;)

Seriously, though. Terminals? Escape codes? Impedance mismatches
involving term types and escape codes? What is this, the Dark Ages?
Those kinds of problems simply should not trouble us in the 21st
century.

Tassilo Horn

unread,
Jan 3, 2012, 2:33:18 AM1/3/12
to clo...@googlegroups.com
Baishampayan Ghose <b.g...@gmail.com> writes:

Hi Baishampayan,

>> Getting colors outside M-x clojure-jack-in requires a couple extra
>> steps I forgot to document, I just added it here:
>>
>> https://github.com/technomancy/swank-clojure/commit/94fa71f90e52c55d74
>
> Thanks, the above steps worked--almost. I now see the raw ANSI color
> escape codes and not the colors. How do I tell Emacs to interpret the
> color codes the right way?

,----[ C-h f ansi-color-for-comint-mode-on RET ]
| ansi-color-for-comint-mode-on is an interactive compiled Lisp function in
| `ansi-color.el'.
|
| (ansi-color-for-comint-mode-on)
|
| Set `ansi-color-for-comint-mode' to t.
`----

Bye,
Tassilo

Baishampayan Ghose

unread,
Jan 3, 2012, 2:40:40 AM1/3/12
to clo...@googlegroups.com
On Tue, Jan 3, 2012 at 1:03 PM, Tassilo Horn <tas...@member.fsf.org> wrote:
>> Thanks, the above steps worked--almost. I now see the raw ANSI color
>> escape codes and not the colors. How do I tell Emacs to interpret the
>> color codes the right way?
>
> ,----[ C-h f ansi-color-for-comint-mode-on RET ]
> | ansi-color-for-comint-mode-on is an interactive compiled Lisp function in
> | `ansi-color.el'.
> |
> | (ansi-color-for-comint-mode-on)
> |
> | Set `ansi-color-for-comint-mode' to t.

Thanks Tassilo, but that turns on ansi color for the shell, and not
the sldb buffer with the stacktrace. Is there any way to enable that
globally?

Tassilo Horn

unread,
Jan 3, 2012, 3:32:10 AM1/3/12
to clo...@googlegroups.com
Baishampayan Ghose <b.g...@gmail.com> writes:

Hi Baishampayan,

>> ,----[ C-h f ansi-color-for-comint-mode-on RET ]


>> | ansi-color-for-comint-mode-on is an interactive compiled Lisp function in
>> | `ansi-color.el'.
>> |
>> | (ansi-color-for-comint-mode-on)
>> |
>> | Set `ansi-color-for-comint-mode' to t.
>
> Thanks Tassilo, but that turns on ansi color for the shell,

Well, for all modes that interact with some process using comint, like
shell, term, and some others. It seems sldb-mode is not a comint mode.

> and not the sldb buffer with the stacktrace. Is there any way to
> enable that globally?

Not that I know of. But you could try to run the ansi translation in
sldb-mode-hook.

--8<---------------cut here---------------start------------->8---
(defun th-ansi-colorize-buffer ()
(ansi-color-apply-on-region (point-min) (point-max)))

(add-hook 'sldb-mode-hook 'th-ansi-colorize-buffer)
--8<---------------cut here---------------end--------------->8---

It might be that the hook is run before the stacktrace is actually
inserted in the buffer. In that case, you should add the colorizing
function into a buffer-local after-change-functions hook like so:

--8<---------------cut here---------------start------------->8---
(defun th-ansi-colorize-buffer ()
(ansi-color-apply-on-region (point-min) (point-max)))

(defun th-sldb-mode-init ()
(add-hook 'after-change-functions 'th-ansi-colorize-buffer t t))

(add-hook 'sldb-mode-hook 'th-sldb-mode-init)
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo

Baishampayan Ghose

unread,
Jan 3, 2012, 3:41:40 AM1/3/12
to clo...@googlegroups.com
Tassilo,

> Not that I know of.  But you could try to run the ansi translation in
> sldb-mode-hook.
>
> --8<---------------cut here---------------start------------->8---
> (defun th-ansi-colorize-buffer ()
>  (ansi-color-apply-on-region (point-min) (point-max)))
>
> (add-hook 'sldb-mode-hook 'th-ansi-colorize-buffer)
> --8<---------------cut here---------------end--------------->8---
>
> It might be that the hook is run before the stacktrace is actually
> inserted in the buffer.  In that case, you should add the colorizing
> function into a buffer-local after-change-functions hook like so:
>
> --8<---------------cut here---------------start------------->8---
> (defun th-ansi-colorize-buffer ()
>  (ansi-color-apply-on-region (point-min) (point-max)))
>
> (defun th-sldb-mode-init ()
>  (add-hook 'after-change-functions 'th-ansi-colorize-buffer t t))
>
> (add-hook 'sldb-mode-hook 'th-sldb-mode-init)
> --8<---------------cut here---------------end--------------->8---

The first option didn't do anything. Calling th-ansi-colorize-buffer
manually on the sldb buffer gave me an error saying that the buffer is
read-only.

The second option gives an error the moment the sldb buffer comes up. It says -

error in process filter: insert: Wrong number of arguments: (lambda
nil (ansi-color-apply-on-region (point-min) (point-max))), 3

Tassilo Horn

unread,
Jan 3, 2012, 3:54:45 AM1/3/12
to clo...@googlegroups.com
Baishampayan Ghose <b.g...@gmail.com> writes:

Hi again,

> The second option gives an error the moment the sldb buffer comes
> up. It says -
>
> error in process filter: insert: Wrong number of arguments: (lambda
> nil (ansi-color-apply-on-region (point-min) (point-max))), 3

Ah, yes. Now I've installed clj-stacktrace myself, and this is a fully
working, hardcore tested emacs config. ;-)

--8<---------------cut here---------------start------------->8---
(defun th-ansi-colorize-region (start end old-len)
(ansi-color-apply-on-region start end))

(defun th-sldb-mode-init ()
(add-hook 'after-change-functions 'th-ansi-colorize-region nil t))

(add-hook 'sldb-mode-hook 'th-sldb-mode-init)
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo

Baishampayan Ghose

unread,
Jan 3, 2012, 4:04:41 AM1/3/12
to clo...@googlegroups.com
> Getting colors outside M-x clojure-jack-in requires a couple extra steps
> I forgot to document, I just added it here:
>
> https://github.com/technomancy/swank-clojure/commit/94fa71f90e52c55d74

Just curious, you mention loading the file `slime-compile-presave`,
but I wonder what it has got to do with colors in the stacktrace.

Did you mean this file instead?
https://github.com/technomancy/swank-clojure/blob/master/src/swank/payload/slime-frame-colors.el

Phil Hagelberg

unread,
Jan 3, 2012, 12:31:28 PM1/3/12
to clo...@googlegroups.com
Baishampayan Ghose <b.g...@gmail.com> writes:

>> Getting colors outside M-x clojure-jack-in requires a couple extra steps
>> I forgot to document, I just added it here:
>>
>> https://github.com/technomancy/swank-clojure/commit/94fa71f90e52c55d74
>
> Just curious, you mention loading the file `slime-compile-presave`,
> but I wonder what it has got to do with colors in the stacktrace.
>
> Did you mean this file instead?
> https://github.com/technomancy/swank-clojure/blob/master/src/swank/payload/slime-frame-colors.el

Quite right; just a slip up on my part. I've updated the readme.

-Phil

Phil Hagelberg

unread,
Jan 3, 2012, 12:32:00 PM1/3/12
to clo...@googlegroups.com
Cedric Greevey <cgre...@gmail.com> writes:

> Seriously, though. Terminals? Escape codes? Impedance mismatches
> involving term types and escape codes? What is this, the Dark Ages?
> Those kinds of problems simply should not trouble us in the 21st
> century.

Plonk.

Cedric Greevey

unread,
Jan 3, 2012, 1:12:20 PM1/3/12
to clo...@googlegroups.com

Beg pardon?

Just seems to me that reading about someone seeing ANSI escape
garbaging up their screen, this long after the 1980s, is like hearing
someone complain that their vehicle's engine threw a shoe
post-1920-or-so. :)

Takahiro

unread,
Jan 3, 2012, 9:15:48 PM1/3/12
to clo...@googlegroups.com
Phil

> There are lots of problems with version ranges, but this would be a bad> idea for Ring specifically because it would allow backwards-incompatible> versions to be pulled in when a new breaking clj-stacktrace version is> released.

Thank you for sharing your thoughts.

2012/1/2 Phil Hagelberg <ph...@hagelb.org>:

Jack Moffitt

unread,
Jan 4, 2012, 2:27:04 AM1/4/12
to clo...@googlegroups.com
> The main feature in this release is Derek Mansen's work integrating
> clj-stacktrace into the debugger frames, so now you can get stack traces
> with alignment and colorization. I'm very excited about this release
> since it's a significant usability improvement: http://imgur.com/fD3rA

I get the aligned and nicer stack traces, but no colors. I see
"Invalid face color" in *Messages* repeated many times, so I suspect
that has something to do with it. I've tried both clojure-jack-in and
the lein swank instructions given in the README. I'm using GNU Emacs
24.0.92.1 with clojure-mode 1.11.5. Any ideas?

jack.

Reply all
Reply to author
Forward
0 new messages