On Nov 4, 4:07 pm, Chas Emerick <cemer...@snowtide.com> wrote: > I've only looked at the code for ~5 minutes, but I think I might understand > what's going on. To confirm: clojure-refactoring is sending something like > diffs back to the refactoring-mode/SLIME, and that mode/emacs is what is > actually performing the modifications to affected files?
Basically, what's happening is that the emacs code sends snippets of code + some argument to the clojure backend, and gets a new snippet back replacing the old one. For instance, extract-fn gets called with a string representing the original function, another string representing the expression to extract and a function name, and it returns a string representing the extracted function + the original function with the expression replaced by a call to the new function. Similar things happen with the threading functions and rename. The emacs side of things pretty much consists of selecting, replacing and re-indenting expressions. On Nov 4, 4:30 pm, Laurent PETIT <laurent.pe...@gmail.com> wrote: > Hello, > > As far as I remember, clojure-refactoring considered (or is using ?) > using parsley + the clojure grammar in paredit.clj for some (all ?) of > its refactorings. > > What is the current status of this ? (I also have a long delayed todo > list note on adding refactoring to CCW, for sure ! :-) ) clojure-refactoring currently doesn't use paredit.clj at all, it still has its own parsley clojure grammar in clojure- refactoring.support.parser I haven't looked at paredit's grammar. it may be useful to use that, especially if we can have some common higher-level operations on parsed clojure trees (simple things like "find the argument list for this function" etc), but I just haven't had the time to look into it. Joost. -- 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 Note that posts from new members are moderated - please be patient with your first post. 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