Re: [ANN] clj-refactor.el 0.10.0
Didn't mean to imply that you should try to corner the market in refactorings, but simply thought you might be wanting to promote a useful Clojure tool across editors. I'm not sure if Chris views Light Table as a Clojure-centric editor though at this point, Clojure probably does have the best support. As far as LT not having this kind of functionality already, the plugin system was just recently (around a month) formalized so that's to be expected. Given that the editor is developed in ClojureScript, I assumed that a port from Emacs Lisp might not be as much work as going to a different language altogether. On Saturday, February 1, 2014 4:30:47 PM UTC-5, Magnar Sveen wrote: Sorry, mate. It's not about cornering the market in clojure refactorings - it's just scratching our own itch, and hopefully other people find it useful too. I'm a little surprised Light Table doesn't offer these things already. Isn't it a Clojure-centric editor? On Saturday, February 1, 2014 8:22:53 PM UTC+1, adrians wrote: Really cool stuff, guys. Are you considering a Light Table version as well? -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] clj-refactor.el 0.10.0
Slam dunk! Looking forward to trying this out. On Thursday, January 30, 2014 5:13:36 AM UTC-8, Magnar Sveen wrote: clj-refactor.el Since the last update, there's been lots of activity for clj-refactor.elhttps://github.com/magnars/clj-refactor.el . Alex Baranosky https://github.com/AlexBaranosky and Lars Andersenhttps://github.com/expez have joined the team, and here are the new features: More let refactorings Starting with: (defn handle-request (let [body (find-body abc)] {:status 200 :body body})) With the cursor in front of 200, I do cljr-move-to-let: (defn handle-request (let [body (find-body abc) X 200] {:status X :body body})) Again I have two cursors where the Xes are, so I type out the name, and press enter: (defn handle-request (let [body (find-body abc) status 200] {:status status :body body})) Pretty handy. And it works with if-let and when-let too. *Thread first all, thread last all, unwind all* Convenience functions to thread all the way down, or unwind the entire threading macro. Cycling Privacy Given this function: (defn add [a b] (+ a b)) I do cljr-cycle-privacy: (defn- add [a b] (+ a b)) I do cljr-cycle-privacy again to return to the original: (defn add [a b] (+ a b)) Given this def: (def config docs {:env staging}) I do cljr-cycle-privacy: (def ^:private config docs {:env staging}) I do cljr-cycle-privacy again to return to the original: (def config docs {:env staging}) https://github.com/magnars/clj-refactor.el#cycling-collection-typeCycling Collection Type Given this collection: (:a 1 :b 2) I do cljr-cycle-coll to return: {:a 1 :b 2} ... and then 3 more times: [:a 1 :b 2]#{:a 1 :b 2}(:a 1 :b 2) https://github.com/magnars/clj-refactor.el#cycling-between-strings-and-keywordsCycling Between Strings and Keywords Given this string: refactor I do cljr-cycle-stringlike to return: :refactor ... and then 3 more times: refactor:refactorrefactor Thanks to Jay Fields https://github.com/jaycfields and emacs-livehttps://github.com/overtone/emacs-live for these cycling features. Good idea! Destructuring keys Given this: (defn- render-recommendation [rec] (list [:h3 (:title rec)] [:p (:by rec)] [:p (:blurb rec) (render-link (:link rec))])) I place the cursor on rec inside [rec] and do cljr-destructure-keys: (defn- render-recommendation [{:keys [title by blurb link]}] (list [:h3 title] [:p by] [:p blurb (render-link link)])) If rec had still been in use, it would have added an :as clause. For now this feature is limited to top-level symbols in a let form. PR welcome. https://github.com/magnars/clj-refactor.el#stop-referringStop referring Given this: (ns cljr.core (:require [my.lib :as lib :refer [a b]])) (+ (a 1) (b 2)) I place cursor on my.lib and do cljr-stop-referring: (ns cljr.core (:require [my.lib :as lib])) (+ (lib/a 1) (lib/b 2)) https://github.com/magnars/clj-refactor.el#optional-setupEven more There's also - cljr-sort-ns to sort the namespace - cljr-replace-use to replace old :use statements with new :refer :all statements. - cljr-add-declaration to declare the defn you're in. So, clj-refactor.el still knows nothing about your code. At some point we want to piggyback on an nrepl-connection to do the tricky parts of refactoring, but for now we're happy to make life a little easier. Hope you enjoy! -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] clj-refactor.el 0.10.0
Slam dunk! Looking forward to trying this out. -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] clj-refactor.el 0.10.0
Really cool stuff, guys. Are you considering a Light Table version as well? -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] clj-refactor.el 0.10.0
adrians, Personally, for my part in clj-refactor.el, I don't have any interest in porting it to Light Table. The project depends pretty heavily on other Emacs packages such as paredit, multiple-cursors, and yas-snippets, so it's not trivial to port. On Sat, Feb 1, 2014 at 11:22 AM, adrians nman...@gmail.com wrote: Really cool stuff, guys. Are you considering a Light Table version as well? -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] clj-refactor.el 0.10.0
Sorry, mate. It's not about cornering the market in clojure refactorings - it's just scratching our own itch, and hopefully other people find it useful too. I'm a little surprised Light Table doesn't offer these things already. Isn't it a Clojure-centric editor? On Saturday, February 1, 2014 8:22:53 PM UTC+1, adrians wrote: Really cool stuff, guys. Are you considering a Light Table version as well? -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] clj-refactor.el 0.10.0
Great job by the clj-refactor.el team!! Really nice additions. On Thursday, January 30, 2014 6:43:36 PM UTC+5:30, Magnar Sveen wrote: clj-refactor.el Since the last update, there's been lots of activity for clj-refactor.elhttps://github.com/magnars/clj-refactor.el . Alex Baranosky https://github.com/AlexBaranosky and Lars Andersenhttps://github.com/expez have joined the team, and here are the new features: More let refactorings Starting with: (defn handle-request (let [body (find-body abc)] {:status 200 :body body})) With the cursor in front of 200, I do cljr-move-to-let: (defn handle-request (let [body (find-body abc) X 200] {:status X :body body})) Again I have two cursors where the Xes are, so I type out the name, and press enter: (defn handle-request (let [body (find-body abc) status 200] {:status status :body body})) Pretty handy. And it works with if-let and when-let too. *Thread first all, thread last all, unwind all* Convenience functions to thread all the way down, or unwind the entire threading macro. Cycling Privacy Given this function: (defn add [a b] (+ a b)) I do cljr-cycle-privacy: (defn- add [a b] (+ a b)) I do cljr-cycle-privacy again to return to the original: (defn add [a b] (+ a b)) Given this def: (def config docs {:env staging}) I do cljr-cycle-privacy: (def ^:private config docs {:env staging}) I do cljr-cycle-privacy again to return to the original: (def config docs {:env staging}) https://github.com/magnars/clj-refactor.el#cycling-collection-typeCycling Collection Type Given this collection: (:a 1 :b 2) I do cljr-cycle-coll to return: {:a 1 :b 2} ... and then 3 more times: [:a 1 :b 2]#{:a 1 :b 2}(:a 1 :b 2) https://github.com/magnars/clj-refactor.el#cycling-between-strings-and-keywordsCycling Between Strings and Keywords Given this string: refactor I do cljr-cycle-stringlike to return: :refactor ... and then 3 more times: refactor:refactorrefactor Thanks to Jay Fields https://github.com/jaycfields and emacs-livehttps://github.com/overtone/emacs-live for these cycling features. Good idea! Destructuring keys Given this: (defn- render-recommendation [rec] (list [:h3 (:title rec)] [:p (:by rec)] [:p (:blurb rec) (render-link (:link rec))])) I place the cursor on rec inside [rec] and do cljr-destructure-keys: (defn- render-recommendation [{:keys [title by blurb link]}] (list [:h3 title] [:p by] [:p blurb (render-link link)])) If rec had still been in use, it would have added an :as clause. For now this feature is limited to top-level symbols in a let form. PR welcome. https://github.com/magnars/clj-refactor.el#stop-referringStop referring Given this: (ns cljr.core (:require [my.lib :as lib :refer [a b]])) (+ (a 1) (b 2)) I place cursor on my.lib and do cljr-stop-referring: (ns cljr.core (:require [my.lib :as lib])) (+ (lib/a 1) (lib/b 2)) https://github.com/magnars/clj-refactor.el#optional-setupEven more There's also - cljr-sort-ns to sort the namespace - cljr-replace-use to replace old :use statements with new :refer :all statements. - cljr-add-declaration to declare the defn you're in. So, clj-refactor.el still knows nothing about your code. At some point we want to piggyback on an nrepl-connection to do the tricky parts of refactoring, but for now we're happy to make life a little easier. Hope you enjoy! -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] clj-refactor.el 0.10.0
Wow! This looks really cool. +1 On Thu, Jan 30, 2014 at 05:13:36AM -0800, Magnar Sveen wrote: clj-refactor.el Since the last update, there's been lots of activity for clj-refactor.elhttps://github.com/magnars/clj-refactor.el . Alex Baranosky https://github.com/AlexBaranosky and Lars Andersenhttps://github.com/expez have joined the team, and here are the new features: More let refactorings Starting with: (defn handle-request (let [body (find-body abc)] {:status 200 :body body})) With the cursor in front of 200, I do cljr-move-to-let: (defn handle-request (let [body (find-body abc) X 200] {:status X :body body})) Again I have two cursors where the Xes are, so I type out the name, and press enter: (defn handle-request (let [body (find-body abc) status 200] {:status status :body body})) Pretty handy. And it works with if-let and when-let too. *Thread first all, thread last all, unwind all* Convenience functions to thread all the way down, or unwind the entire threading macro. Cycling Privacy Given this function: (defn add [a b] (+ a b)) I do cljr-cycle-privacy: (defn- add [a b] (+ a b)) I do cljr-cycle-privacy again to return to the original: (defn add [a b] (+ a b)) Given this def: (def config docs {:env staging}) I do cljr-cycle-privacy: (def ^:private config docs {:env staging}) I do cljr-cycle-privacy again to return to the original: (def config docs {:env staging}) https://github.com/magnars/clj-refactor.el#cycling-collection-typeCycling Collection Type Given this collection: (:a 1 :b 2) I do cljr-cycle-coll to return: {:a 1 :b 2} ... and then 3 more times: [:a 1 :b 2]#{:a 1 :b 2}(:a 1 :b 2) https://github.com/magnars/clj-refactor.el#cycling-between-strings-and-keywordsCycling Between Strings and Keywords Given this string: refactor I do cljr-cycle-stringlike to return: :refactor ... and then 3 more times: refactor:refactorrefactor Thanks to Jay Fields https://github.com/jaycfields and emacs-livehttps://github.com/overtone/emacs-live for these cycling features. Good idea! Destructuring keys Given this: (defn- render-recommendation [rec] (list [:h3 (:title rec)] [:p (:by rec)] [:p (:blurb rec) (render-link (:link rec))])) I place the cursor on rec inside [rec] and do cljr-destructure-keys: (defn- render-recommendation [{:keys [title by blurb link]}] (list [:h3 title] [:p by] [:p blurb (render-link link)])) If rec had still been in use, it would have added an :as clause. For now this feature is limited to top-level symbols in a let form. PR welcome. https://github.com/magnars/clj-refactor.el#stop-referringStop referring Given this: (ns cljr.core (:require [my.lib :as lib :refer [a b]])) (+ (a 1) (b 2)) I place cursor on my.lib and do cljr-stop-referring: (ns cljr.core (:require [my.lib :as lib])) (+ (lib/a 1) (lib/b 2)) https://github.com/magnars/clj-refactor.el#optional-setupEven more There's also - cljr-sort-ns to sort the namespace - cljr-replace-use to replace old :use statements with new :refer :all statements. - cljr-add-declaration to declare the defn you're in. So, clj-refactor.el still knows nothing about your code. At some point we want to piggyback on an nrepl-connection to do the tricky parts of refactoring, but for now we're happy to make life a little easier. Hope you enjoy! -- -- 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. pgpnEutW8rSxB.pgp Description: PGP signature