David <dsieg...@yahoo.com> writes:

> I can't really claim to be handy with elisp, but I got by.
> (Is there a guide to elisp functions anywhere? The Lisp
> reference didn't include the Common Lisp emulation library,
> and I never did find an equivalent to the clojure filter()).

The Elisp CL emulation package is documented in its own top-level Info
node for some reason rather than in the Elisp manual.

> Anyway, here's what I added to my .emacs:
>
> (defun add-slime-mode-to-existing-buffers ()
>   (interactive)
>   (let ((clojure-buffers (remove-if-not 'is-clojure-buffer (buffer-
> list))))
>     (dolist (b clojure-buffers)
>       (set-buffer b)
>       (slime-mode))))
> (eval-after-load 'slime '(add-slime-mode-to-existing-buffers))

Cool! It's a little simpler to check for the value of the major-mode
local variable rather than to use the filename, so here's what I ended
up with:

(defun clojure-enable-slime-on-existing-buffers ()
  (interactive)
  (dolist (buffer (buffer-list))
    (if (equal '(major-mode . clojure-mode)
               (assoc 'major-mode (buffer-local-variables buffer)))
        (with-current-buffer buffer
          (slime-mode t)))))

> Let me know if you add it to your repository.

I've committed this to my copy, but I don't know when it will go
upstream to the mainline clojure-mode branch, as the maintainer has been
out of communication for some time.

http://github.com/technomancy/clojure-mode/

> There could conceivably be some issues with multiple slime
> connections, or with running slime-mode repeatedly on the same
> buffer. I couldn't find any easy way to determine if a buffer already
> had slime-mode -- love to hear from someone who is actually handy
> with elisp!

Calling slime-mode with an argument of t forces it to enable rather than
toggling it. I don't know about multiple slime connections though; it
seems kind of edge-casey, though I can look into it if it causes
problems.

Thanks for getting the ball rolling on this.

-Phil

--~--~---------~--~----~------------~-------~--~----~
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