all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Branham <alex.branham@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: 32896-done@debbugs.gnu.org
Subject: bug#32896: 27.0.50; wishlist: Delete matching pairs
Date: Mon, 08 Oct 2018 18:29:36 -0500	[thread overview]
Message-ID: <87ftxgf25b.fsf@gmail.com> (raw)
In-Reply-To: <87a7not799.fsf@mail.linkov.net>

[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]


On Mon 08 Oct 2018 at 17:15, Juri Linkov <juri@linkov.net> wrote:

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

Yay! I didn't know about that command (and I really did search before
reporting this bug, no idea how I missed it!). It doesn't work backward
though as far as I can tell:

(let (message "%s" "foobar")|)

M-x delete-pair there does nothing. I was hopeful about
`electric-pair-delete-pair' but it only works if the pair is adjacent.

I guess this is closer to what I wanted:

(defun my/delete-pair ()
  "Call `delete-pair', perhaps also calling `backward-up-list'."
  (interactive)
  (condition-case nil (delete-pair)
    (t (progn (backward-up-list)
              (delete-pair)))))

Anyway, thanks for the response!

Alex

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2018-10-08 23:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 14:34 bug#32896: 27.0.50; wishlist: Delete matching pairs Alex Branham
2018-10-08 22:15 ` Juri Linkov
2018-10-08 23:29   ` Alex Branham [this message]
2018-10-16 23:00     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ftxgf25b.fsf@gmail.com \
    --to=alex.branham@gmail.com \
    --cc=32896-done@debbugs.gnu.org \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.