This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-01
Channels
- # announcements (1)
- # babashka (1)
- # beginners (45)
- # business (3)
- # calva (43)
- # clojure (57)
- # clojure-spec (6)
- # clojure-uk (4)
- # clojured (8)
- # clojurescript (14)
- # cryogen (3)
- # datomic (2)
- # emacs (36)
- # fulcro (20)
- # garden (2)
- # jobs (2)
- # lumo (3)
- # meander (9)
- # off-topic (1)
- # other-lisps (1)
- # reagent (13)
- # shadow-cljs (25)
- # spacemacs (20)
- # tools-deps (11)
Any *Doom Emacs* users use any safe structural editing
modes here? If yes, how do you configure it?
I use doom. As for safe editing, I use it. I’ts pretty much auto configured. I added in my config the following:
(add-hook! smartparens-mode
(evil-cleverparens-mode)
(evil-unimpaired-mode)
(smartparnes-strict-mode))
Since smartparens is enabled by default (AFAIK) Keep in mind that I’m an emacs noob so this my be overkill/incorrect - YMMV
would i need to install evil-cleverparens-mode
for it?
dont think that exists by default? I too am just starting out with Doom
Yup - just add it to packages.el in your doom directory
I also added unimpared - you can just delete it if you don’t use it (it’s from my vim days)
I added
(package! evil-cleverparens)
in packages.el
and
(add-hook! smartparens-mode
(evil-cleverparens-mode)
(smartparens-strict-mode))
in config.el
but i can still delete the closing braces, what i am missing?what i want is the
(spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hooks)
like behaviour. But cant find its source to copy too 😕
yeah i did that
I should not be able to delete closing parens, braces right?
ah, the mode is activated. the spacemacs one doesnt let me delete the closing ones in addition to this too. was hoping i can get that behavior here too
For me, deleting occurs, but it deletes both the opening AND the closing parens - thus keeping my s-expression balanced
@U0JLDMT9P does it work for example in (def a (+ 1 2)) and I delete the ) after 2? The one before + is deleted too? Or only if the sexp is empty? The first case is not possible in spacemacs.
@U8QBZBHGD that was my intent too. But failing to find where that could be defined
Or I guess I will reset my head and muscles and just follow doom 😄 really liking its snappy speeds and lean features, specially compared to spacemacs. Thanks for the pointers @U8QBZBHGD
Sounds like smart-parens is not in strict mode, if you can delete parens and leave them unbalanced.
@U05254DQM where can i find the impl of (spacemacs/toggle-evil-safe-lisp-structural-editing-on-register-hooks)
?
@U050PEFK2 still I'm able to delete the closing braces and leave it unbalanced. These are all the changes I made in config.el:
(add-hook! smartparens-mode
(smartparens-global-strict-mode))
it says the strict mode is on and also I cannot _add a ) back after i have unbalanced it. it says cannot do that in strict mode 😕I believe that toggle code is generated by other code, so no explicit code to copy.
ah okay
Are you deleting close parens in Evil insert mode or Evil normal mode
in insert mode
Very strange then. Unless something is broken with the package, then it sounds like something is conflicting with something else in doom or another package. I am just guessing now (not a doom user)
yeah im beginning to think so too. I have asked this on their discord channel now. fingers crossed! Thanks for the help @U05254DQM
> I removed smartparens in favor of paredit. Why though? you could just do M-x sp-use-paredit-bindings
For the reason that was mentioned earlier: smartparens allows me to unbalance parens a little too easily. I find that paredit makes that a bit more difficult.
@UJCC6CE9E smartparens in strict mode prevents deletion of parens where that would make them unbalanced. smartparens is included in Spacemacs (a simple config to set to strict mode). There seems to be an issue using smartparens in Doom for some people.