GNU bug report logs - #11191
C-x C-x does not activate the selection anymore with cua-selection-mode

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> gnu.org>

Date: Sat, 7 Apr 2012 03:29:02 UTC

Severity: normal

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11191 in the body.
You can then email your comments to 11191 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Sat, 07 Apr 2012 03:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dan Nicolaescu <dann <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 07 Apr 2012 03:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: C-x C-x does not activate the selection anymore with
	cua-selection-mode
Date: Fri, 06 Apr 2012 23:27:31 -0400
emacs -Q

M-x cua-selection-mode RET

C-SPC C-f C-f C-f
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.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Sun, 08 Apr 2012 13:20:01 GMT) Full text and rfc822 format available.

Message #8 received at 11191 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Kim F. Storm  <storm <at> cua.dk>
Cc: Dan Nicolaescu <dann <at> gnu.org>, 11191 <at> debbugs.gnu.org
Subject: Re: bug#11191: C-x C-x does not activate the selection anymore with
	cua-selection-mode
Date: Sun, 08 Apr 2012 21:18:17 +0800
Dan Nicolaescu <dann <at> gnu.org> writes:

[recipe edited]

> emacs -Q
> M-x cua-selection-mode RET
> M-<
> 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 <storm <at> cua.dk>
  branch nick: trunk
  timestamp: Fri 2011-01-14 16:06:17 +0100
  message:
  * 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Mon, 09 Apr 2012 05:52:02 GMT) Full text and rfc822 format available.

Message #11 received at 11191 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: Chong Yidong <cyd <at> gnu.org>
Cc: 11191 <at> debbugs.gnu.org, "Kim F. Storm" <storm <at> cua.dk>
Subject: Re: bug#11191: C-x C-x does not activate the selection anymore with
	cua-selection-mode
Date: Mon, 09 Apr 2012 01:50:12 -0400
Chong Yidong <cyd <at> gnu.org> writes:

> Dan Nicolaescu <dann <at> gnu.org> writes:
>
> [recipe edited]
>
>> emacs -Q
>> M-x cua-selection-mode RET
>> M-<
>> 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 <storm <at> cua.dk>
>   branch nick: trunk
>   timestamp: Fri 2011-01-14 16:06:17 +0100
>   message:
>   * 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
cua-selection-mode.

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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Mon, 09 Apr 2012 11:02:01 GMT) Full text and rfc822 format available.

Message #14 received at 11191 <at> debbugs.gnu.org (full text, mbox):

From: Kim Storm <storm <at> cua.dk>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: 11191 <at> debbugs.gnu.org, Chong Yidong <cyd <at> gnu.org>
Subject: Re: 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
On 04/09/2012 07:50 AM, Dan Nicolaescu wrote:
> Chong Yidong<cyd <at> gnu.org>  writes:
>
>> Dan Nicolaescu<dann <at> gnu.org>  writes:
>>
>> [recipe edited]
>>
>>> emacs -Q
>>> M-x cua-selection-mode RET
>>> M-<
>>> 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<storm <at> cua.dk>
>>    branch nick: trunk
>>    timestamp: Fri 2011-01-14 16:06:17 +0100
>>    message:
>>    * 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
> cua-selection-mode.
>
> 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))
    (exchange-point-and-mark)
    (if cua--rectangle
    (cua--rectangle-corner 0))
    (if arg
    (setq mark-active ma))))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Mon, 09 Apr 2012 11:09:02 GMT) Full text and rfc822 format available.

Message #17 received at 11191 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Kim Storm <storm <at> cua.dk>
Cc: Dan Nicolaescu <dann <at> gnu.org>, 11191 <at> debbugs.gnu.org,
	Chong Yidong <cyd <at> gnu.org>
Subject: Re: bug#11191: C-x C-x does not activate the selection anymore with
	cua-selection-mode
Date: Mon, 9 Apr 2012 13:06:33 +0200
On Mon, Apr 9, 2012 at 13:00, Kim Storm <storm <at> cua.dk> wrote:
> On 04/09/2012 07:50 AM, Dan Nicolaescu wrote:
>>
>> Chong Yidong<cyd <at> gnu.org>  writes:
>>
>>> Dan Nicolaescu<dann <at> gnu.org>  writes:
>>>
>>> [recipe edited]
>>>
>>>> emacs -Q
>>>> M-x cua-selection-mode RET
>>>> M-<
>>>> 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<storm <at> cua.dk>
>>>   branch nick: trunk
>>>   timestamp: Fri 2011-01-14 16:06:17 +0100
>>>   message:
>>>   * 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
>> cua-selection-mode.
>>
>> 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.

I agree that it would be very annoying if C-x C-x activates the region
when cua-mode is on!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Mon, 09 Apr 2012 14:18:02 GMT) Full text and rfc822 format available.

Message #20 received at 11191 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: Kim Storm <storm <at> cua.dk>
Cc: 11191 <at> debbugs.gnu.org, Chong Yidong <cyd <at> gnu.org>
Subject: Re: bug#11191: C-x C-x does not activate the selection anymore with
	cua-selection-mode
Date: Mon, 09 Apr 2012 10:16:42 -0400
Kim Storm <storm <at> cua.dk> writes:

> On 04/09/2012 07:50 AM, Dan Nicolaescu wrote:
>> Chong Yidong<cyd <at> gnu.org>  writes:
>>
>>> Dan Nicolaescu<dann <at> gnu.org>  writes:
>>>
>>> [recipe edited]
>>>
>>>> emacs -Q
>>>> M-x cua-selection-mode RET
>>>> M-<
>>>> 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<storm <at> cua.dk>
>>>    branch nick: trunk
>>>    timestamp: Fri 2011-01-14 16:06:17 +0100
>>>    message:
>>>    * 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
>> cua-selection-mode.
>>
>> 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"

It might be, but the behavior before your changes has been available in
two major releases (22.x and 23.x), with no complaints from users (that
I could find).  
Changing behavior on a highly visible feature is not something that we
should take lightly.


> 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.

You might want to do something different for cua-mode vs
cua-selection-mode (where C-x C-x has no other problems).


> - 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))
>     (exchange-point-and-mark)
>     (if cua--rectangle
>     (cua--rectangle-corner 0))
>     (if arg
>     (setq mark-active ma))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Mon, 09 Apr 2012 16:51:01 GMT) Full text and rfc822 format available.

Message #23 received at 11191 <at> debbugs.gnu.org (full text, mbox):

From: Kim Storm <storm <at> cua.dk>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: 11191 <at> debbugs.gnu.org, Chong Yidong <cyd <at> gnu.org>
Subject: Re: bug#11191: C-x C-x does not activate the selection anymore with
	cua-selection-mode
Date: Mon, 09 Apr 2012 18:49:44 +0200
On 04/09/2012 04:16 PM, Dan Nicolaescu wrote:
> You might want to do something different for cua-mode vs
> cua-selection-mode (where C-x C-x has no other problems).
>

You are right -- maybe this version suits all:

(defun cua-exchange-point-and-mark (arg)
  "Exchanges point and mark.

Don't activate the mark if `cua-enable-cua-keys` is non-nil.
Just activate the mark if a prefix argument is given.

See also `exchange-point-and-mark'."
  (interactive "P")
  (if cua-enable-cua-keys
      (if arg
      (setq mark-active t)
    (let (mark-active)
      (exchange-point-and-mark)
      (if cua--rectangle
          (cua--rectangle-corner 0))))
    (exchange-point-and-mark arg)))

Would someone pls. commit this change.
Here is a change log entry:

     * emulation/cua-base.el (cua-exchange-point-and-mark):
     Fallback to exchange-point-and-mark when cua-enable-cua-keys is nil.

Then you can also close bug #6199

Thanks
Kim




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Fri, 13 Apr 2012 03:16:02 GMT) Full text and rfc822 format available.

Message #26 received at 11191 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: Kim Storm <storm <at> cua.dk>
Cc: 11191 <at> debbugs.gnu.org, Chong Yidong <cyd <at> gnu.org>
Subject: Re: bug#11191: C-x C-x does not activate the selection anymore with
	cua-selection-mode
Date: Thu, 12 Apr 2012 23:13:53 -0400
Kim Storm <storm <at> cua.dk> writes:

> On 04/09/2012 04:16 PM, Dan Nicolaescu wrote:
>> You might want to do something different for cua-mode vs
>> cua-selection-mode (where C-x C-x has no other problems).
>>
>
> You are right -- maybe this version suits all:
>
> (defun cua-exchange-point-and-mark (arg)
>   "Exchanges point and mark.
>
> Don't activate the mark if `cua-enable-cua-keys` is non-nil.
> Just activate the mark if a prefix argument is given.
>
> See also `exchange-point-and-mark'."
>   (interactive "P")
>   (if cua-enable-cua-keys
>       (if arg
>       (setq mark-active t)
>     (let (mark-active)
>       (exchange-point-and-mark)
>       (if cua--rectangle
>           (cua--rectangle-corner 0))))
>     (exchange-point-and-mark arg)))
>
> Would someone pls. commit this change.

This works fine.

Yidong, I think this can go in whatever branch will be used for 24.1.
(Sorry, I can't check it in myself).



> Here is a change log entry:
>
>      * emulation/cua-base.el (cua-exchange-point-and-mark):
>      Fallback to exchange-point-and-mark when cua-enable-cua-keys is nil.
>
> Then you can also close bug #6199
>
> Thanks
> Kim




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11191; Package emacs. (Fri, 13 Apr 2012 07:12:01 GMT) Full text and rfc822 format available.

Message #29 received at 11191 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: 11191 <at> debbugs.gnu.org, Kim Storm <storm <at> cua.dk>
Subject: Re: bug#11191: C-x C-x does not activate the selection anymore with
	cua-selection-mode
Date: Fri, 13 Apr 2012 15:10:30 +0800
Dan Nicolaescu <dann <at> gnu.org> writes:

>> Would someone pls. commit this change.
>
> This works fine.
>
> Yidong, I think this can go in whatever branch will be used for 24.1.
> (Sorry, I can't check it in myself).

Done.  Thanks everyone.




bug closed, send any further explanations to 11191 <at> debbugs.gnu.org and Dan Nicolaescu <dann <at> gnu.org> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 13 Apr 2012 07:13:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 May 2012 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.