Delete current (non-atomic) s-expression in Emacs

emacs, paredit

Solution

I didn't find a predefined command either.

Fortunately, with Emacs it's really easy to implement your own.

For example:

(define-key global-map (kbd "C-c C-d") 
    (lambda () (interactive) (backward-up-list) (paredit-kill)))

Problem

Is there an easy way to delete the smallest-possible non-atomic s-expression based on the cursor location? I want to turn this (the "|" is the cursor) ``` (defun foo (bar) (if bar |789 (+ 456 123))) ``` into this ``` (defun foo (bar) |) ``` It seems like a useful thing to be able to do, but I couldn't find a relevant (one-step) command on the Paredit cheat sheet.

Original source