GNU bug report logs - #24755
25.1; Selection continues with no mouse button pressed

Previous Next

Package: emacs;

Reported by: Mats Palmgren <matspal <at> gmail.com>

Date: Fri, 21 Oct 2016 15:36:02 UTC

Severity: normal

Found in version 25.1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#24755: closed (25.1; Selection continues with no mouse button
 pressed)
Date: Wed, 26 Oct 2016 19:31:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 26 Oct 2016 15:29:55 -0400
with message-id <jwvy41a7w8c.fsf-monnier+emacsbugs <at> gnu.org>
and subject line Re: bug#24755: 25.1; Selection continues with no mouse button pressed
has caused the debbugs.gnu.org bug report #24755,
regarding 25.1; Selection continues with no mouse button pressed
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
24755: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24755
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mats Palmgren <matspal <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; Selection continues with no mouse button pressed
Date: Fri, 21 Oct 2016 16:56:00 +0200
1. Visit a buffer with some text
2. Press the left mouse button
3. Drag the mouse to select some text
4. Press the Control key
5. Release the mouse button
6. Continue to move the mouse

Actual Result:
Moving the mouse continues to select text, even though no mouse button
or keys are pressed.

Expected Result:
Selection should stop at 5.

Unfortunately, it's fairly common for me to do 4 before 5 (in
preparation for deleting the selection with C-w for example) so
version 25 is unusable for me with this bug.  This is a new
behavior in v25, it's not present in v23 or earlier versions
that I've used.

In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9)
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Ubuntu 16.04.1 LTS


Thanks,
Mats



[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24755-done <at> debbugs.gnu.org, Mats Palmgren <matspal <at> gmail.com>
Subject: Re: bug#24755: 25.1; Selection continues with no mouse button pressed
Date: Wed, 26 Oct 2016 15:29:55 -0400
> Stefan, could you please fix this?  It seems to be due to changes in
> how mouse-drag-track handles mouse events: in Emacs 24.5, the code
> handled mouse clicks as well, whereas now it doesn't seem to.  So
> releasing the mouse button while Ctrl or Shift is pressed signals an
> error now, instead of finishing the drag event.

> The fix should go to the emacs-25 branch.

I pushed the patch below to emacs-25, which should fix it.


        Stefan


diff --git a/lisp/subr.el b/lisp/subr.el
index 573f238..07909b8 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4507,8 +4507,10 @@ set-transient-map
                         ;; exit C-u.
                         t)
                        ((eq t keep-pred)
-                        (eq this-command
-                            (lookup-key map (this-command-keys-vector))))
+                        (let ((mc (lookup-key map (this-command-keys-vector))))
+                          ;; If the key is unbound `this-command` is
+                          ;; nil and so is `mc`.
+                          (and mc (eq this-command mc))))
                        (t (funcall keep-pred)))
                 (funcall exitfun)))))
     (add-hook 'pre-command-hook clearfun)


This bug report was last modified 8 years and 266 days ago.

Previous Next


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