GNU bug report logs -
#38431
27.0.50; mouse-drag-region-rectangle needs transient-mark-mode
Previous Next
Reported by: Stephen Berman <stephen.berman <at> gmx.net>
Date: Fri, 29 Nov 2019 21:14:01 UTC
Severity: normal
Found in version 27.0.50
Done: Mattias Engdegård <mattiase <at> acm.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 38431 in the body.
You can then email your comments to 38431 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38431
; Package
emacs
.
(Fri, 29 Nov 2019 21:14:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stephen Berman <stephen.berman <at> gmx.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 29 Nov 2019 21:14:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
After updating from master I wanted to try the new
mouse-drag-region-rectangle command but it didn't work with my init file,
and I found the reason was I have transient-mark-mode customized to
nil. To reproduce:
0. emacs -Q (transient-mark-mode enabled)
1. Type `C-M-mouse-1', drag the mouse and a retangle gets selected.
2. M-x transient-mark-mode (now disabled)
3. Type `C-M-mouse-1', drag the mouse and no retangle gets selected.
I found no indication in NEWS, the Emacs manual or the doc string of
mouse-drag-region-rectangle that it is not supposed to work with
transient-mark-mode disabled, so I assume this is a bug. This patch
makes it work with t-m-m disabled:
[Message part 2 (text/x-patch, inline)]
diff --git a/lisp/mouse.el b/lisp/mouse.el
index f076e90bd9..fd0ef2a360 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1999,6 +1999,8 @@ mouse-drag-region-rectangle
(unless dragged
;; This is actually a drag.
(setq dragged t)
+ (unless transient-mark-mode
+ (setq transient-mark-mode 'lambda))
(mouse-minibuffer-check start-event)
(deactivate-mark)
(posn-set-point start-pos)
[Message part 3 (text/plain, inline)]
However, this is not the right, or at least the complete, fix, because
it has some bad side-effects: after disabling t-m-m and then selecting a
rectangle with the mouse, now typing `M-x transient-mark-mode' still
says it is disabled; after typing it again, it is now enabled, but
typing C-SPC and then moving point does not show an active region; only
after typing C-SPC C-SPC and then anything (e.g. C-g) and then again
typing C-SPC and moving point is an active region shown. So a better or
more complete fix is needed.
In GNU Emacs 27.0.50 (build 26, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0)
of 2019-11-29 built on strobe-lfs84
Repository revision: b2790db049da98b541d07bac21ca7d7c220d3be0
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Linux From Scratch
Configured using:
'configure --with-cairo 'CFLAGS=-Og -g3'
PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig'
Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS JSON PDUMPER LCMS2
GMP
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38431
; Package
emacs
.
(Sun, 01 Dec 2019 17:45:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 38431 <at> debbugs.gnu.org (full text, mbox):
Thank you, I've added a variant of your suggested change and pushed to master (9f2145f42d).
This does not really cure the special case you mention, but unless I'm mistaken, linear text selection with the mouse exhibits a similar (identical?) quirk. I'm not sure if it's a problem in practice since it requires a specific sequence of events.
Is the change good enough for everyday use? If not, please help elaborate, and if you think that linear text selection needs attention.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38431
; Package
emacs
.
(Sun, 01 Dec 2019 20:43:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 38431 <at> debbugs.gnu.org (full text, mbox):
On Sun, 1 Dec 2019 18:44:26 +0100 Mattias Engdegård <mattiase <at> acm.org> wrote:
> Thank you, I've added a variant of your suggested change and pushed to master
> (9f2145f42d).
I updated and confirm that C-M-mouse-1 now selects a rectangle also when
transient-mark-mode is disabled, and also that I don't see the bad
side-effects I saw with my patch. Thanks!
> This does not really cure the special case you mention, but unless I'm
> mistaken, linear text selection with the mouse exhibits a similar (identical?)
> quirk. I'm not sure if it's a problem in practice since it requires a specific
> sequence of events.
I'm not sure what you're referring to here; as noted, your patch doesn't
have the bad side-effects I observed with my patch. And I don't recall
seeing any such behavior when selecting a region with mouse-1 help down
(I assume that's what you mean by linear text selection with the mouse),
before your patch and don't see it with it either.
> Is the change good enough for everyday use? If not, please help elaborate, and
> if you think that linear text selection needs attention.
Unless I'm misunderstanding what you mean, I see no problems with
selection (rectangular or linear) with the mouse now.
Steve Berman
Reply sent
to
Mattias Engdegård <mattiase <at> acm.org>
:
You have taken responsibility.
(Sun, 01 Dec 2019 20:47:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Stephen Berman <stephen.berman <at> gmx.net>
:
bug acknowledged by developer.
(Sun, 01 Dec 2019 20:47:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 38431-done <at> debbugs.gnu.org (full text, mbox):
1 dec. 2019 kl. 21.42 skrev Stephen Berman <stephen.berman <at> gmx.net>:
> I'm not sure what you're referring to here; as noted, your patch doesn't
> have the bad side-effects I observed with my patch. And I don't recall
> seeing any such behavior when selecting a region with mouse-1 help down
> (I assume that's what you mean by linear text selection with the mouse),
> before your patch and don't see it with it either.
That's good --- I must have misunderstood you then, or conducted my experiments clumsily. Thanks!
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 30 Dec 2019 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 176 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.