Here's a better version that handles finding inner classes in Java
source:

diff --git a/swank/commands/basic.clj b/swank/commands/basic.clj
index d668d2d..32c01b7 100644
--- a/swank/commands/basic.clj
+++ b/swank/commands/basic.clj
@@ -330,8 +330,14 @@ that symbols accessible in the current namespace
go first."

 (defn source-location-for-frame [frame]
   (let [line     (.getLineNumber frame)
-        frame-ns ((re-find #"(.*?)\$" (.getClassName frame)) 1)
-        filename (str (namespace-to-path (symbol frame-ns)) File/
separator (.getFileName frame))
+        filename (if (.. frame getFileName (endsWith ".java"))
+                  (.. frame getClassName (replace \. \/)
+                      (substring 0 (.lastIndexOf (.getClassName frame) "."))
+                      (concat (str File/separator (.getFileName frame))))
+                  (str (namespace-to-path
+                        (symbol ((re-find #"(.*?)\$"
+                                          (.getClassName frame)) 1)))
+                       File/separator (.getFileName frame)))
         path     (slime-find-file-in-paths filename (slime-search-
paths))]
     `(:location ~path (:line ~line) nil)))

@@ -373,7 +379,7 @@ that symbols accessible in the current namespace
go first."
 (defslimefn frame-catch-tags-for-emacs [n] nil)
 (defslimefn frame-locals-for-emacs [n] nil)

-(defslimefn frame-source-location-for-emacs [n]
+(defslimefn frame-source-location [n]
   (source-location-for-frame
      (nth (.getStackTrace *current-exception*) n)))

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to