unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
@ 2012-04-07  3:27 Dan Nicolaescu
  2012-04-08 13:18 ` Chong Yidong
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Nicolaescu @ 2012-04-07  3:27 UTC (permalink / raw)
  To: 11191


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.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
  2012-04-07  3:27 bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode Dan Nicolaescu
@ 2012-04-08 13:18 ` Chong Yidong
  2012-04-09  5:50   ` Dan Nicolaescu
  0 siblings, 1 reply; 9+ messages in thread
From: Chong Yidong @ 2012-04-08 13:18 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: Dan Nicolaescu, 11191

Dan Nicolaescu <dann@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@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
  2012-04-08 13:18 ` Chong Yidong
@ 2012-04-09  5:50   ` Dan Nicolaescu
  2012-04-09 11:00     ` Kim Storm
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Nicolaescu @ 2012-04-09  5:50 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 11191, Kim F. Storm

Chong Yidong <cyd@gnu.org> writes:

> Dan Nicolaescu <dann@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@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
  2012-04-09  5:50   ` Dan Nicolaescu
@ 2012-04-09 11:00     ` Kim Storm
  2012-04-09 11:06       ` Lennart Borgman
  2012-04-09 14:16       ` Dan Nicolaescu
  0 siblings, 2 replies; 9+ messages in thread
From: Kim Storm @ 2012-04-09 11:00 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 11191, Chong Yidong

On 04/09/2012 07:50 AM, Dan Nicolaescu wrote:
> Chong Yidong<cyd@gnu.org>  writes:
>
>> Dan Nicolaescu<dann@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@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))))






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
  2012-04-09 11:00     ` Kim Storm
@ 2012-04-09 11:06       ` Lennart Borgman
  2012-04-09 14:16       ` Dan Nicolaescu
  1 sibling, 0 replies; 9+ messages in thread
From: Lennart Borgman @ 2012-04-09 11:06 UTC (permalink / raw)
  To: Kim Storm; +Cc: Dan Nicolaescu, 11191, Chong Yidong

On Mon, Apr 9, 2012 at 13:00, Kim Storm <storm@cua.dk> wrote:
> On 04/09/2012 07:50 AM, Dan Nicolaescu wrote:
>>
>> Chong Yidong<cyd@gnu.org>  writes:
>>
>>> Dan Nicolaescu<dann@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@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!





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
  2012-04-09 11:00     ` Kim Storm
  2012-04-09 11:06       ` Lennart Borgman
@ 2012-04-09 14:16       ` Dan Nicolaescu
  2012-04-09 16:49         ` Kim Storm
  1 sibling, 1 reply; 9+ messages in thread
From: Dan Nicolaescu @ 2012-04-09 14:16 UTC (permalink / raw)
  To: Kim Storm; +Cc: 11191, Chong Yidong

Kim Storm <storm@cua.dk> writes:

> On 04/09/2012 07:50 AM, Dan Nicolaescu wrote:
>> Chong Yidong<cyd@gnu.org>  writes:
>>
>>> Dan Nicolaescu<dann@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@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))))





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
  2012-04-09 14:16       ` Dan Nicolaescu
@ 2012-04-09 16:49         ` Kim Storm
  2012-04-13  3:13           ` Dan Nicolaescu
  0 siblings, 1 reply; 9+ messages in thread
From: Kim Storm @ 2012-04-09 16:49 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 11191, Chong Yidong

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
  2012-04-09 16:49         ` Kim Storm
@ 2012-04-13  3:13           ` Dan Nicolaescu
  2012-04-13  7:10             ` Chong Yidong
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Nicolaescu @ 2012-04-13  3:13 UTC (permalink / raw)
  To: Kim Storm; +Cc: 11191, Chong Yidong

Kim Storm <storm@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode
  2012-04-13  3:13           ` Dan Nicolaescu
@ 2012-04-13  7:10             ` Chong Yidong
  0 siblings, 0 replies; 9+ messages in thread
From: Chong Yidong @ 2012-04-13  7:10 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 11191, Kim Storm

Dan Nicolaescu <dann@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-04-13  7:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-07  3:27 bug#11191: C-x C-x does not activate the selection anymore with cua-selection-mode Dan Nicolaescu
2012-04-08 13:18 ` Chong Yidong
2012-04-09  5:50   ` Dan Nicolaescu
2012-04-09 11:00     ` Kim Storm
2012-04-09 11:06       ` Lennart Borgman
2012-04-09 14:16       ` Dan Nicolaescu
2012-04-09 16:49         ` Kim Storm
2012-04-13  3:13           ` Dan Nicolaescu
2012-04-13  7:10             ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).