Q for emacs/spacemacs users: what's the right sequence of commands to wrap an expression into a let
block? For instance, i have (something blah)
, and I need to turn it into (let [s (something blah)])
- so far I can think of "slurp forward", then "visually select between parens" and "surround with [", but that feels clunky. What say you, Emacs wizards?
@peterbak: there’s clj-refactor, which can do these kinds of things (I’ve heard)
it deffo can
you introduce let: https://github.com/clojure-emacs/clj-refactor.el/blob/master/examples/introduce-let.gif
you might need to expand it: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-expand-let
or if you have a a let already you just move your s-exp there:
https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-move-to-let
whoa, that's neat
this one works without a repl even
enjoy :simple_smile:
that's a whole other world
that is just the tip of the 🗻 😉
I need to explore cljr more... I only really us it for the threading operations
we just cleaning up the documentation at the moment perhaps moving stuff from the readme to the wiki
getting ready for 1.1.0
I use nothing but slurp
. 😄
dealing with 🍻 ? 😉
☕ & 🍺 ;D
little late to the party, but for that let thing, I'd just put my cursor at the beginning of (something blah)
, type (let [s
and slurp twice.
@bhagany: good point.. didn't realize slurping works with square brackets
How do I change the color for "... cannot be resolved"? I want it to be really visible
in Cursive
borkdude: Hmm, looks like you can’t configure that right now. I’ll fix that so you can set it using an inspection config.
@cfleming: if it's not too much trouble... I only needed it this afternoon
@cfleming: when I was refactoring something
@borkdude: Yeah, I already do that with some of the other inspections, it’s pretty easy to add - that one was the first annotation I added a long time ago
Any :emacs: users know of something like http-client that works under Org (with babel) ?
or indeed how to make httpclient work that way