Closed cmccloud closed 9 years ago
So the reason I see is here https://github.com/expez/evil-smartparens/blob/master/evil-smartparens.el#L80-L81. D goes up one sexp then backwards and down to find the deletion point.
I would think a simple sp-forward-sexp
would work here, but I'm probably not appreciating all of the possibilities.
The readme is actually out of sync. I try to do readme driven development and this is what I first wanted, so I get the confusion. The docstring is correct, though, and says: "Emulate `sp-kill-sexp' with universal prefix."
In the example in the OP I usually do da(
, but you could also call sp-kill-sexp
.
My goal was to make something that was greater than the sum of its parts (evil and smartparens) and not just duplicate existing behavior across new keybindings.
There's also evil-cleverparens to consider, it's quite similar to this package and the author is a great guy.
thanks!
To make it clear why I prefer to have it this way, and not like sp-kill-sexp
:
(defun test-sexp () |(sexp-A (A-first-child)) (sexp-B) (sexp-C (C-first-child) (C-second-child)))
If I now it D
I get:
(defun test-sexp () |)
which is quite handy!
@expez Just a thought. In evil-sp--get-endpoint-for-sp-kill-sexp
, what if this were the rule?
I think that handles both cases.
Never mind. That would be weird in this case
| (a (b
)
)
@expez I agree, and definitely see the usefulness here.
You can also delete the sexp in the OP by doing d<sp-forward-sexp>
. With the keybindings I've set up for myself this equates to dM-l
. This variant also supports prefixes so by doing 2dM-l
I can delete the following two sexps. Isn't it lovely when commands compose in this way? :)
Using spacemacs, with evil, smart-parens, smart-parens-strict, and evil-smartparens enabled in an emacs-lisp buffer
My expectation is that "D" should delete sexp-A and it's child, but leave sexp-B and sexp-C, instead D results in:
Is this intended? Others are noticing the same behavior, the discussion is located syl20bnr/spacemacs#2747