Thanks for the tip. I've added it to swank-clojure (only if you have clojure.contrib installed though, so don't forget to have that around).
- Jeff On Apr 17, 12:14 pm, David Nolen <dnolen.li...@gmail.com> wrote: > If you have the latest version of clojure.contrib you can do the following: > Modify the namespace declaration in swank-clojure/swank/commands/basic.clj > to look like the following: > > (ns swank.commands.basic > (:refer-clojure :exclude [load-file]) > (:use (swank util commands core) > (swank.util.concurrent thread) > (swank.util string clojure) > clojure.contrib.pprint) > (:require (swank.util [sys :as sys])) > (:import (java.io StringReader File) > (java.util.zip ZipFile) > (clojure.lang LineNumberingPushbackReader))) > > In the same file modify apply-macro-expander to look like the following: > > (defn- apply-macro-expander [expander string] > (binding [*print-suppress-namespaces* true] > (with-pprint-dispatch *code-dispatch* > (write (expander (read-from-string string)) :pretty true :stream > nil)))) > > Now that pprint is a part of contrib, these two changes should probably be > incorporated into swank-clojure. > > On Fri, Apr 17, 2009 at 2:39 PM, Paul Drummond > <paul.drumm...@iode.co.uk>wrote: > > > > > Up until now I have made do with a simple clojure repl in Emacs but as > > I am playing around with macros I feel it's time to test drive > > clojure-swank and it's fancy macro expansion features! > > > I have installed clojure-swank following the instructions on the wiki > > and the installation seems to have worked. I can launch slime and I > > get a clojure repl. If I evaluate a function, then switch back to my > > editor and type the function name followed by a space the arguments > > for the function appear thanks to Slime. So far so good. > > > When it comes to trying out other commands some things work, things > > don't work as expected. While I am curious which features are > > available and which features others use on a daily basis, at the > > moment I just want to focus on getting macro expansion to work. > > > Can someone please explain what steps I need to take to get > > macro-expansion to work from a stock swank-clojure installation? I > > tried following the steps explained in a previous thread (the pprint > > announcement) but I get confused as these instructions refer to > > cl-format which was before pprint was added to clojure-contrib. > > > Thanks, > > Paul. > > -- > > Iode Software Ltd, registered in England No. 6299803. > > > Registered Office Address: 12 Sancroft Drive, Houghton-le-Spring, Tyne > > & Wear, DH5 8NE. > > > This message is intended only for the use of the person(s) ("the > > intended recipient(s)") to whom it is addressed. It may contain > > information which is privileged and confidential within the meaning of > > applicable law. If you are not the intended recipient, please contact > > the sender as soon as possible. The views expressed in this > > communication may not necessarily be the views held by The Company. > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---