Subject: bug#16085: 24.3.50; electric-pair-mode and cua-mode clash when autowrapping region

From: Stefan Monnier <[email-masked]>
Date: Sun, 08 Dec 2013 01:25:17 -0500

> Hello maintainers,
>     emacs -Q
>     M-x cua-mode
>     M-x electric-pair-mode
>     insert foo
>     select region "foo"
>     press "("
>     should get "(foo)", get ")(" instead.

> This is a problem I solved in my third-party autopair.el library using
> this horrible code

That's a problem we already solved for delete-selection-mode (see patch
below).  So we just need to port this fix to cua-mode.  Even better
is to make cua-mode use delete-selection-mode.

I installed a patch which does that.

        Stefan