Subject: Re: bug#18952: 24.4; delete weirdness in cua mode
From: Stefan Monnier <[email-masked]>
To: Andy Grover <[email-masked]>
Cc: Eli Zaretskii <[email-masked]>, [email-masked]
Date: Fri, 07 Nov 2014 14:56:07 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Version:24.5

> Ah! ok, I also have cua-highlight-region-shift-only t in my Customize
> section, so I hit this without trying? But here's a way to repro,
> starting from emacs -Q:

Ah, I see it now.  I installed the patch below, which seems to fix it.
Thanks,

        Stefan

=== modified file 'lisp/emulation/cua-base.el'
--- lisp/emulation/cua-base.el	2014-10-31 15:31:27 +0000
+++ lisp/emulation/cua-base.el	2014-11-07 19:51:19 +0000
@@ -1199,7 +1199,7 @@
 (defun cua--select-keymaps ()
   ;; Setup conditions for selecting the proper keymaps in cua--keymap-alist.
   (setq cua--ena-region-keymap
-	(and mark-active (not deactivate-mark)))
+	(and (region-active-p) (not deactivate-mark)))
   (setq cua--ena-prefix-override-keymap
 	(and cua--ena-region-keymap
 	     cua-enable-cua-keys