On Thu, Jan 8, 2009 at 2:13 PM, Bill Clementson <billc...@gmail.com> wrote:
> On Thu, Jan 8, 2009 at 11:57 AM, Zak Wilson <zak.wil...@gmail.com> wrote:
>>
>> Everything is fully up to date.
>>
>> The test works. Setting the ns with (ns test) works, but if I use a
>> more complex ns form like (ns test (:use clojure.xml)), it fails to
>> set the ns.
>>
>> As a workaround, (in-ns test) after the ns definition seems to work.
>> Unless there's some reason not to, I'll just do it that way for now.
>> Thanks for the help.
>
> It looks like the regular expression that matches namespaces in
> swank-clojure.el doesn't cater for some combinations of namespace
> statements. Could you evaluate the following elisp function and let me
> know whether this fixes the issue for you:
>
> (defun swank-clojure-find-package ()
>  (let ((regexp "^(\\(clojure.core/\\)?\\(in-\\)?ns\\s-+[:']?\\([^
> ()]*\\>\\)[ ()]"))
>    (save-excursion
>      (when (or (re-search-backward regexp nil t)
>                (re-search-forward regexp nil t))
>        (match-string-no-properties 3)))))
>
> It appears to work ok for me with the following namespace declarations:
> (in-ns 'test)
> (ns test)
> (ns test (:use clojure.xml))
>
> But, it would be good if you could test it with some other
> combinations before I submit it to Jeffrey as a patch.

I have submitted the patch to Jeffrey Chou (the swank-clojure creator)
and he has applied and pushed it. Thanks for reporting the issue.

Cheers,
Bill

--~--~---------~--~----~------------~-------~--~----~
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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to