GNU bug report logs - #21731
24.5; Bug with `transient-mark-mode' wrt `cua-mode'

Previous Next

Package: emacs;

Reported by: Eli Barzilay <eli <at> barzilay.org>

Date: Thu, 22 Oct 2015 05:24:02 UTC

Severity: normal

Found in version 24.5

Done: Eli Zaretskii <eliz <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 21731 in the body.
You can then email your comments to 21731 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#21731; Package emacs. (Thu, 22 Oct 2015 05:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eli Barzilay <eli <at> barzilay.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 22 Oct 2015 05:24:02 GMT) Full text and rfc822 format available.

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

From: Eli Barzilay <eli <at> barzilay.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; Bug with `transient-mark-mode' wrt `cua-mode'
Date: Thu, 22 Oct 2015 01:22:04 -0400
This is a bug that I ran into with 24.5.1:

* Run emacs -Q

* Use shifted arrow keys to make some transient selection (on by
  default, so no need to do any customizations).

* Use C-x b to switch to another buffer

* Use unshifted arrows to move in this buffer

* C-x b back into the first buffer

* Now unshifted arrow movements continue to change the selection, as
  if it was made with C-SPC

FWIW#1, it looks like this bug existed for a while -- I see it with
24.3.1 too.  The reason I didn't see it then is that (IIUC) `cua-mode'
did its own thing (correctly), and it looks like this was dropped and
the functionality from simple.el is used instead.

This is why I qualified this as "wrt cua-mode": the buggy behavior
might be considered correct for people who have used it before and
expect it to happen.  (I doubt this, but that's subjective.)

The reason for this was easy to track: `transient-mark-mode' is a
*global* variable.  After shifted movement, it gets a value of
(only . t), and shifted movements turn it back to t even if they
happen in a different buffer.  (I don't see off-hand any quick way to
fix it, but if anyone has an idea, I'd be happy to know about it.)

The fix should involve some buffer-local version of
`transient-mark-mode', but since it's also used globally as a mode,
this might require a new variable.

If the current behavior is intentional, then this becomes harder to
fix, since it would require having both behaviors available.  It would
still be a bug since it changes functionality for people who use
cua-mode -- which would enable this imaginary extension.

-- 
                    ((x=>x(x))(x=>x(x)))                   Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21731; Package emacs. (Thu, 22 Oct 2015 05:28:02 GMT) Full text and rfc822 format available.

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

From: Eli Barzilay <eli <at> barzilay.org>
To: 21731 <at> debbugs.gnu.org
Subject: Re: bug#21731: Acknowledgement (24.5; Bug with `transient-mark-mode'
 wrt `cua-mode')
Date: Thu, 22 Oct 2015 01:26:48 -0400
On Thu, Oct 22, 2015 at 1:24 AM, GNU bug Tracking System
<help-debbugs <at> gnu.org> wrote:
> [...]

Actually, I did the obvious thing:

    (make-variable-buffer-local 'transient-mark-mode)

and it seems to work fine, so maybe this is the only thing that is
needed.

-- 
                    ((x=>x(x))(x=>x(x)))                   Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 22 Oct 2015 14:53:01 GMT) Full text and rfc822 format available.

Notification sent to Eli Barzilay <eli <at> barzilay.org>:
bug acknowledged by developer. (Thu, 22 Oct 2015 14:53:02 GMT) Full text and rfc822 format available.

Message #13 received at 21731-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eli Barzilay <eli <at> barzilay.org>
Cc: 21731-done <at> debbugs.gnu.org
Subject: Re: bug#21731: 24.5; Bug with `transient-mark-mode' wrt `cua-mode'
Date: Thu, 22 Oct 2015 17:51:51 +0300
> From: Eli Barzilay <eli <at> barzilay.org>
> Date: Thu, 22 Oct 2015 01:22:04 -0400
> 
> This is a bug that I ran into with 24.5.1:
> 
> * Run emacs -Q
> 
> * Use shifted arrow keys to make some transient selection (on by
>   default, so no need to do any customizations).
> 
> * Use C-x b to switch to another buffer
> 
> * Use unshifted arrows to move in this buffer
> 
> * C-x b back into the first buffer
> 
> * Now unshifted arrow movements continue to change the selection, as
>   if it was made with C-SPC

Thanks, this is already fixed in the development sources (I did
reproduce the problem in stock Emacs 24.5).  I guess it was fixed when
the implementation of transient-mark-mode and the region was
rewritten.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 20 Nov 2015 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 216 days ago.

Previous Next


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