On Nov 14, 4:09 pm, "Graham Fawcett" <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 4:01 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Nov 14, 2008, at 3:38 PM, Graham Fawcett wrote:
>
> > I'm sure there's a work-around, of course. The meta information is still
> > there:
>
> > This appears to be because the sources are no longer included in
> > clojure.jar. I added "<path-to-clojure-trunk-svn-directory>/src/clj" to my
> > classpath and now it works.
>
> Thanks, Steve -- an easy fix!
>
> Best,
> Graham
>
> > --Steve

M-. will jump to wrong place if defs are not in namespace master .clj.
I already reported it to swank-clojure owner. I guess the fix should
be in git repo soon.

This should fix it.

(defn- namespace-to-path [ns]
  (let [ns-str (name (ns-name ns))]
    (-> ns-str
        (.substring 0 (.lastIndexOf ns-str "."))
        (.replace \- \_)
        (.replace \. \/))))

(defslimefn find-definitions-for-emacs [name]
  (let [sym-name (read-from-string name)
        sym-var (ns-resolve (maybe-ns *current-package*) sym-name)]
    (when-let [meta (and sym-var (meta sym-var))]
        (if-let [path (or (slime-find-file-in-paths (str (namespace-to-
path (:ns meta))
                                                         (.separator
File)
                                                         (:file meta))
(slime-search-paths))
;; This is OK for namespace master .clj, but not for help files.
;                          (slime-find-file-in-paths (str (namespace-
to-path (:ns meta)) ".clj")
;                                                    (slime-search-
paths))
                          (slime-find-file-in-paths (:file meta)
(slime-search-paths)))]
        `((~(str "(defn " (:name meta) ")")
           (:location
            ~path
            (:line ~(:line meta))
            nil)))
        `((~(str (:name meta))
           (:error "Source definition not found.")))))))

regards,

- Feng
--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to