Fork me on GitHub

Any *Doom Emacs* users use any safe structural editing modes here? If yes, how do you configure it?

Nir Rubinstein12:03:53

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

Nir Rubinstein12:03:33

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

Nir Rubinstein12:03:33

Yup - just add it to packages.el in your doom directory

Nir Rubinstein12:03:25

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
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

Nir Rubinstein16:03:33

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.


After modifying config files you have to do doom refresh :)


@U050PEFK2 yes i did that pretty much after every change 🙂


@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
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.


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


Maybe Try to reach henrik on doom’s discord?


I removed smartparens in favor of paredit. Works pretty well for me.


> 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.


Is there a package that prevents me from deleting parens in normal mode?


@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.


It seems to be working with evil-paredit in Doom


I'm still deciding between Doom and Spacemacs (and cursive which is the one I usually use 🙂 )