Hi Tom, On Tue, Dec 9, 2008 at 12:28 PM, Tom Emerson <[EMAIL PROTECTED]> wrote: > > Nice post as always, Bill.
Thanks. :) > One thing I add to my .emacs for SLIME/Clojure is the following: > > (global-set-key "\C-cs" 'slime-selector) > (def-slime-selector-method ?l > "most recently visited clojure-mode buffer." > (slime-recently-visited-buffer 'clojure-mode)) > > This rebinds the selector shortcut for switching to the most recent > lisp-mode buffer to switch to the most recent Clojure mode buffer. > This lets me switch back and forth between the REPL and the file I'm > editing easily with C-c s r and C-c s l. That's a good tip. Normally the "l" binding of slime-selector takes you to the last lisp-mode buffer, so changing it to go to the last clojure-mode buffer is really useful. However, if you're using SLIME with other Lisps as well, you probably wouldn't want that to be the global binding for the "l" selector. You can run multiple REPL's simultaneously, so (for example), you might have SBCL running in one SLIME REPL and Clojure running in another SLIME REPL; therefore, you would probably want the "l" selector to go to the CL source buffer when you're working in the SBCL REPL. So, instead of overriding the "l" selector, you could create a new "j" binding for clojure-mode files: (def-slime-selector-method ?j "most recently visited clojure-mode buffer." (slime-recently-visited-buffer 'clojure-mode)) That way, you could switch between the SBCL REPL and a CL source buffer with C-c s r and C-c s l and switch between a Clojure REPL and a Clojure source buffer with C-c s r and C-c s j. Alternatively, I guess you could either defadvice the slime-selector function to swap the "l" method depending on whether the REPL was SBCL or Clojure or write a "wrapper" function that called either function as appropriate. Thanks, Bill --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
