1

I wrote a simple function, that makes emacs add matching quotes (so when I type ", I get "{cursor}"). But now, it's a major annoyance when I delete the first quote but the second is still remaining.

Is there a way to "listen" for character deletion events, and it the next character is matching the deleted one, delete the next character as well?

Rogach
  • 26,050
  • 21
  • 93
  • 172

1 Answers1

3

There are existing minor modes for this. See AutoPairs at the EmacsWiki.

autopair.el has the specific functionality you're describing.

(electric-pair-mode in Emacs 24 does not, it would seem).

Related Q&As (mentioning autopair):

Community
  • 1
  • 1
phils
  • 71,335
  • 11
  • 153
  • 198