This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-15
Channels
- # admin-announcements (1)
- # announcements (11)
- # asami (6)
- # aws (26)
- # babashka (17)
- # beginners (119)
- # bristol-clojurians (7)
- # chlorine-clover (2)
- # cider (3)
- # circleci (1)
- # clj-kondo (10)
- # clojure (127)
- # clojure-australia (3)
- # clojure-dusseldorf (5)
- # clojure-europe (135)
- # clojure-france (5)
- # clojure-nl (8)
- # clojure-uk (6)
- # clojurescript (103)
- # clojurewerkz (1)
- # css (2)
- # cursive (5)
- # datalog (5)
- # datomic (36)
- # emacs (3)
- # events (2)
- # figwheel-main (3)
- # fulcro (1)
- # graalvm (3)
- # helix (31)
- # jobs-discuss (4)
- # leiningen (1)
- # london-clojurians (1)
- # malli (17)
- # off-topic (2)
- # parinfer (10)
- # portal (1)
- # re-frame (48)
- # reitit (2)
- # reveal (12)
- # shadow-cljs (3)
- # sql (3)
- # tools-deps (4)
- # vim (4)
- # xtdb (22)
(Also posted in #emacs)
I've been trying to get parinfer v3 (aka "smart-mode") to work in Emacs. I've been using it in Cursive.
I've found two implementations:
1. parinfer-mode, the smart
branch: https://github.com/DogLooksGood/parinfer-mode/tree/smart
2. parinfer-rust-mode: https://github.com/justinbarclay/parinfer-rust-mode
I've been able to get both up and running, but none of them seem to work like the reference implementation:
https://shaunlebron.github.io/parinfer/demo
A test that I made is to type a (
in front of the {:sum ...
map. Both implementations don't automatically "slurp" the hashmap into a pair of parens (ie turning it into
({:sum sum
:prod prod})
Anyone had other experiences?@grav I would expect (
to just introduce ()
unless you are using paredit as well.
That's not how the reference implementation which I linked to, as well as Cursive, which implements paredit smart-mode, behaves
For parinfer-rust
, and parinfer-rust-mode
, if paredit mode is on it forces parens to be balanced before parinfer
operates on the buffer. Therefore, parinfer won't infer that it should wrap the following sexp.
cc @grav
Thanks, that makes sense! I'm pretty new to Emacs, and I apparently am not able to disable paredit in a simple way with prelude, so I am unable to test it.
Ah, apparently it's called smartparens, and yes, disabling it does seem to make the specific scenario work!
Awesome glad to here it 🙂
If you always want smartparens turned off in a particular major-mode, you could use something like:
(add-hook 'clojure-mode-hook (lambda () (smartparens-mode -1)))
I assume that this holds true for smartparens as well.