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?
There are existing minor modes for this. See AutoPairs at the EmacsWiki.
autopair.el has the specific functionality you’re describing.
(
electric-pair-modein Emacs 24 does not, it would seem).Related Q&As (mentioning autopair):