[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11191: C-x C-x does not activate the selection anymore with cua-sele

From: Kim Storm
Subject: bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
Date: Mon, 09 Apr 2012 13:00:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20111114 Icedove/3.1.16

On 04/09/2012 07:50 AM, Dan Nicolaescu wrote:
Chong Yidong<address@hidden>  writes:

Dan Nicolaescu<address@hidden>  writes:

[recipe edited]

emacs -Q
M-x cua-selection-mode RET
C-SPC C-f C-f C-f C-g
C-x C-x

now the selection should be active, but it is not.
This worked in emacs-23.3, so this is a regression.
Looks like this change was made deliberately:

   revno: 102844
   committer: Kim F. Storm<address@hidden>
   branch nick: trunk
   timestamp: Fri 2011-01-14 16:06:17 +0100
   * emulation/cua-base.el (cua--init-keymaps):
   Remap exchange-point-and-mark in cua-global-keymap.

The docstring of `cua-exchange-point-and-mark' says it does not activate
the mark.
Kim, could you confirm that this was the intention?

In emacs-22.3 and 23.3 it does activate the mark.
C-x C-x also activates the mark in the trunk without

Wouldn't it be better that instead of changing something that has been
present in two major releases and is consistent with the default behavior,
to change the docstring?

The current behaviour is "by design"

Personally, I find it very annoying if C-x C-x activates the mark with cua-mode - as it becomes very hard to enter another C-x C-x to cancel it (it actually requires three C-x typed rapidly -- otherwise it will delete the region. That is why cua-exchange-point-and-mark doesn't activate the mark
by default.

- but with reference to bug #6199 on the same subject, I have already approved to change the behaviour
--- if anyone feels it is necessary.

I think the following version should do the trick

(defun cua-exchange-point-and-mark (arg)
  "Exchanges point and mark.
Don't activate the mark if a prefix argument is given."
  (interactive "P")
  (let ((ma mark-active))
    (if cua--rectangle
    (cua--rectangle-corner 0))
    (if arg
    (setq mark-active ma))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]