This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-25
Channels
- # announcements (1)
- # beginners (131)
- # cljs-dev (1)
- # clojure (178)
- # clojure-argentina (1)
- # clojure-dev (3)
- # clojure-uk (2)
- # clojuredesign-podcast (1)
- # clojurescript (16)
- # code-reviews (2)
- # core-async (2)
- # emacs (28)
- # figwheel-main (19)
- # fulcro (11)
- # kaocha (1)
- # leiningen (4)
- # music (6)
- # off-topic (2)
- # re-frame (2)
- # reitit (6)
- # rewrite-clj (9)
- # shadow-cljs (78)
- # slack-help (6)
what is the proper way in clojure-mode
to change a [1 2 3]
to a #{1 2 3}
? I’ve been switvhing to text-mode
to be able to actually change the brackets, which is … not ideal 🙂
I think this is probably due to paredit or smartparens depending on which you have installed, rather than clojure-mode itself
if paredit, I can give you the steps I take, and I'd be happy if anyone had something better --
it's not quite like that -- there's probably a hook in your configuration somewhere that turns on smartparens when clojure-mode is enabled
starting with
[1 2 3]
I put my cursor on the opening bracket and type #
, leaving
#[1 2 3]
then, I use paredit-wrap-curly
, which I bound to M-{
, which leaves me with
#{[1 2 3]}
from there, I put my cursor on the 1
, and use paredit-splice-sexp-killing-backward
, bound to M-up
, which leaves me at the desired result
#{1 2 3}
this is great - i think i need to spend a bit of time mapping some of these to keys
typically what I'll do to solve @st3fan’s issue is ... oh, exactly what @bhagany said
i didn't know about M-up
so i'm stoked about that one. but in this instance it looks like the clojure-mode refactorings are built to do exactly what is desired here
okay this is driving me bananas
(s/def ::platform
(s/keys
:req [:platform/description
:platform/codeShortName
:platform/searchTab
:platform/vendorShortName
:platform/vendor
:platform/id] ))
see that little whitespace at the end? I've tried TAB
, clojure-align
, C-M-\
... that whitespace is very persistentI've also done (setq clojure-align-forms-automatically t)
in init.el
.
anyone have any suggestions for auto-killing the whitespace?