]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix for C-x C-x in cua-selection-mode.
authorChong Yidong <cyd@gnu.org>
Fri, 13 Apr 2012 07:10:11 +0000 (15:10 +0800)
committerChong Yidong <cyd@gnu.org>
Fri, 13 Apr 2012 07:10:11 +0000 (15:10 +0800)
* emulation/cua-base.el (cua-exchange-point-and-mark): Just call
exchange-point-and-mark if cua-enable-cua-keys is nil.

Fixes: debbugs:11191
lisp/ChangeLog
lisp/emulation/cua-base.el

index f7469ddb015231ce739c74ecbfb5fed550c22cae..4b031a5dfe9d57a5ab7ad827f5b04ffbb346f97d 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-13  Kim F. Storm  <storm@cua.dk>
+
+       * emulation/cua-base.el (cua-exchange-point-and-mark): Just call
+       exchange-point-and-mark if cua-enable-cua-keys is nil (Bug#11191).
+
 2012-04-12  Chong Yidong  <cyd@gnu.org>
 
        * custom.el (custom-theme-set-variables): Doc fix.
index a918f298a4ed4eeee07f7ded54dbdea80cb6e406..c31f634dd5c5da56ed84f7a8f6b01aeecb4ecc99 100644 (file)
@@ -1002,15 +1002,21 @@ behavior, see `cua-paste-pop-rotate-temporarily'."
     (setq this-command 'cua-paste-pop))))
 
 (defun cua-exchange-point-and-mark (arg)
-  "Exchanges point and mark, but don't activate the mark.
-Activates the mark if a prefix argument is given."
+  "Exchange point and mark.
+Don't activate the mark if `cua-enable-cua-keys' is non-nil.
+Otherwise, just activate the mark if a prefix ARG is given.
+
+See also `exchange-point-and-mark'."
   (interactive "P")
-  (if arg
-      (setq mark-active t)
-    (let (mark-active)
-      (exchange-point-and-mark)
-      (if cua--rectangle
-         (cua--rectangle-corner 0)))))
+  (cond ((null cua-enable-cua-keys)
+        (exchange-point-and-mark arg))
+       (arg
+        (setq mark-active t))
+       (t
+        (let (mark-active)
+          (exchange-point-and-mark)
+          (if cua--rectangle
+              (cua--rectangle-corner 0))))))
 
 ;; Typed text that replaced the highlighted region.
 (defvar cua--repeat-replace-text nil)