Subject: Re: bug#32896: 27.0.50; wishlist: Delete matching pairs
From: Juri Linkov <[email-masked]>
To: Alex Branham <[email-masked]>
Cc: [email-masked]
Date: Tue, 09 Oct 2018 01:15:30 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> It would be nice if Emacs had a command to remove matching pairs of
> things so that (with | representing point):
>
> (|let (message "%s" "foobar"))
>
> I could delete the parens around the let function. This should work for
> other pairs too:
>
> (let ((foobar "foobar")) (message "%s" "|foobar"))
>
> to delete the quotes around the second "foobar"
>
> I know there are 3rd-party packages that implement this but it seems
> like this should be included with Emacs since it's such a great tool for
> editing.

Fortunately, Emacs already has such a command named ‘delete-pair’:
it deletes the parens around the let function as in your first
example as well as the quotes in your second example.  It makes
sense to bind this command to e.g. ‘C-x M-(’ to be the inverse of
‘M-(’ (insert-pair)