Subject: bug#11520: 24.1.50; delete-selection-mode conflicts with electric-pair-mode

From: Stefan Monnier <[email-masked]>
Date: Sun, 20 May 2012 10:54:30 -0400

> $ emacs -Q
> M-x electric-pair-mode
> M-x delete-selection-mode
> ;; Type "a line of text""
> C-SPC
> C-a
> ;; At this point, you should have the line of text selected
> (

> Expected result:
> (a line of text)
> Actual result:
> )(

Thanks for the recipe.  I'm not sure yet how best to solve
this problem.  Basically, the issue is that delete-selection-mode
operates before the ( is processed, so it has to "guess" what ( will do.

Most likely the cleanest solution will be to add some
"delete-selection-predicates" hook that electric-pair-mode can use to
explain when to inhibit delete-selection.

        Stefan