This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-12
Channels
- # announcements (19)
- # babashka (33)
- # beginners (96)
- # bitcoin (6)
- # cider (11)
- # circleci (5)
- # clj-kondo (22)
- # cljs-dev (4)
- # cljsjs (2)
- # clojure (65)
- # clojure-australia (9)
- # clojure-berlin (1)
- # clojure-europe (53)
- # clojure-italy (2)
- # clojure-nl (2)
- # clojure-uk (42)
- # clojurescript (9)
- # conjure (1)
- # cursive (33)
- # data-oriented-programming (1)
- # data-science (6)
- # datomic (12)
- # emacs (12)
- # fulcro (7)
- # graphql (4)
- # honeysql (5)
- # jobs (2)
- # juxt (8)
- # lsp (30)
- # malli (9)
- # off-topic (9)
- # other-languages (1)
- # re-frame (17)
- # reagent (11)
- # reitit (5)
- # releases (2)
- # remote-jobs (3)
- # shadow-cljs (39)
- # spacemacs (6)
- # sql (2)
- # testing (3)
- # tools-deps (43)
- # vim (5)
- # xtdb (11)
Here's a puzzler for someone. I need to change this
[datomic.api ...][wrapper.datomic.api ...]
to this
[datomic.api ...]
[wrapper.datomic.api ...]
in 217 different files. I tried helm-ag-edit
, but it didn't let me create newlines. Is there an easy way to do this in emacs?Don’t know about that package, but if you’re entering a newline try C-q C-j
, it should enter a newline.
But you can also do this, if you’re just replacing a ][
with ]\n[
:
M-x replace-regexp RET ][ RET ] C-q C-j[ RET
Nice, that would have been great for adding the newline. I ended up using sed
and then manually indenting each file. Thanks for the suggestion!
Yeah, something like this is my fallback. I was just hoping I wouldn't have to write code for it. I have to learn sed
over from scratch every time I use it. 🙂
At least some ways of doing string search and replace in Emacs let you type Ctrl-Q Ctrl-J in the middle of a replacement string to mean a newline
well, anywhere in the replacement string I mean, not just the middle.
Ctrl-Q being an Emacs 'escape' character prefix kind of thing, and Ctrl-J being the ASCII code for a newline

I had to write a post-it note with the C-q C-j
thing as I never remembered it. @U067Q76EP other (I'd say preferable) approach is to get the cljstyle
binary and run it against the whole codebase.