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
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
> 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
> 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
> 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
>> 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
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> 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>:
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.
> 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
> 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
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.
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
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?
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
> 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
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
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
>> 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
> 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.
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. :)
> 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>:
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.