A while ago I hooked Slime's completion and documentation features into the popular Emacs auto-completion framework "auto-complete" (http://www.emacswiki.org/emacs/AutoComplete).
Since it may be of interest to others, I've released the completion plugin on github: http://github.com/purcell/ac-slime
Here's a screenshot of the plugin in action in a clojure-mode buffer, showing the (very handy) pop-up documentation:
-Steve
--
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
Sincerely,
Michał
> This is absolutely awesome! I notice it also works perfectly with
> Common Lisp... I'm in a state of blissful exaltation. :-)
Excellent - so if there are any quirks with this plugin, at least there'll be a couple more users to help fix it up now!
(For instance, it doesn't work perfectly if you type "some-namespace/" and then try to start completion, but that might be something related to my slime completion settings. And also, I haven't managed to bind it to TAB in the REPL yet...)
Incidentally, I've also got a hippie-expand source for SLIME somewhere in my emacs config: http://github.com/purcell/emacs.d
-Steve
Regards,
Heinz
Definitely. :-)
> (For instance, it doesn't work perfectly if you type "some-namespace/" and then try to start completion, but that might be something related to my slime completion settings.
It seems to work for me. I'd gist the relevant part of my config for
you, except I'm not sure which is the relevant part... I'll have to
look closer.
On the other hand, I'm having mixed luck with fuzzy completion...
slime-fuzzy-complete-symbol offers 'with-bindings and 'with-bindings*
as completions for 'wi-bi, but so far I haven't been able to provoke
ac + ac-slime to do the same (with (lambda () (set-up-slime-ac t)) in
my slime-mode-hook and slime-repl-mode-hook).
> And also, I haven't managed to bind it to TAB in the REPL yet...)
(add-hook 'slime-connected-hook
(lambda ()
(define-key slime-mode-map (kbd "TAB") 'auto-complete)
(define-key slime-repl-mode-map (kbd "TAB") 'auto-complete)))
I also put (lambda () (auto-complete-mode t)) in the hooks for
slime-mode and slime-repl-mode.
> Incidentally, I've also got a hippie-expand source for SLIME somewhere in my emacs config: http://github.com/purcell/emacs.d
Cool! I'll look around. :-)
Sincerely,
Michał
Sure:
There are light and dark versions, and I switch between them with "M-x light" and "M-x dark" depending on how my eyes feel: http://github.com/purcell/emacs.d/blob/master/init-themes.el
I'll willingly split the theme out into a separate git repo if it makes a difference to anyone.
-Steve
> On the other hand, I'm having mixed luck with fuzzy completion...
> slime-fuzzy-complete-symbol offers 'with-bindings and 'with-bindings*
> as completions for 'wi-bi, but so far I haven't been able to provoke
> ac + ac-slime to do the same (with (lambda () (set-up-slime-ac t)) in
> my slime-mode-hook and slime-repl-mode-hook).
>
>> And also, I haven't managed to bind it to TAB in the REPL yet...)
>
> (add-hook 'slime-connected-hook
> (lambda ()
> (define-key slime-mode-map (kbd "TAB") 'auto-complete)
> (define-key slime-repl-mode-map (kbd "TAB") 'auto-complete)))
>
> I also put (lambda () (auto-complete-mode t)) in the hooks for
> slime-mode and slime-repl-mode.
Ah, yes, that would work. Using 'slime-connected-hook was the bit I was missing.
Thanks!
-Steve
> Hi,
>
> just yesterday I took a first look at auto-complete together with your
> slime auto completion sources.
>
> I'm encountering some Exceptions, though,
>
> If I'm in a .clj-buffer and start typing
>
> (clojure.
>
> and then wait for the auto completion to popup I see a list of
> possible completions like, e.g., clojure.set, clojure.xml and more,
> and then an Exception pops up:
That seems to be a slime/swank problem, related to accessing the documentation for a symbol corresponding to a namespace. In a clojure-mode buffer, use M-: to execute the following expression:
(slime-eval '(swank:documentation-symbol "clojure.set"))
This results in the same error. I'll cross-post to the swank-clojure list to see if anyone knows what might be going wrong.
-Steve
> That seems to be a slime/swank problem, related to accessing the documentation for a symbol corresponding to a namespace. In a clojure-mode buffer, use M-: to execute the following expression:
>
> (slime-eval '(swank:documentation-symbol "clojure.set"))
>
> This results in the same error. I'll cross-post to the swank-clojure list to see if anyone knows what might be going wrong.
Underlying all this, the following clojure function call produces the error:
(find-doc clojure.set)
-Steve
> Sorry my message got truncated. Let's try again:
>
> Fuzzy completion (ac-source-slime-fuzzy) isn't working for me. It complains that the function slime-fuzzy-completions is not defined. I'm using slime.el version 2010404, which does not define that function, although it does define slime-simple-completions. Not sure if there's a newer version of slime.el out there but I did install fresh about a week or two ago.
>
> Not to worry; I'm very happy with ac-source-slime-simple.
To use fuzzy completions you need to have and require slime-fuzzy.el, which comes with the full slime, but not with the version in ELPA.
-Steve
> I'm experiencing the exact same problem. Haven't found a way to fix
> this yet.
I've fixed the problem in my fork of swank-clojure and requested that Phil pull the commit into the master repo:
http://github.com/purcell/swank-clojure/commit/7172c275f390c59d0b532ec3dc2994b2b9f72167
-Steve
I guess Phil's very busy, but if he can apply this patch, then the regular swank-clojure 1.3.0-SNAPSHOT on clojars should end up containing the fix.
-Steve
Just applied this patch and pushed to github and clojars. Thanks!
-Phil
Hi all,
A while ago I hooked Slime's completion and documentation features into the popular Emacs auto-completion framework "auto-complete" (http://www.emacswiki.org/emacs/AutoComplete).
Since it may be of interest to others, I've released the completion plugin on github: http://github.com/purcell/ac-slime
Here's a screenshot of the plugin in action in a clojure-mode buffer, showing the (very handy) pop-up documentation:
-Steve