GNU bug report logs - #19003
24.4; Mouse-click in different frame displaying same buffer breaks region

Previous Next

Package: emacs;

Reported by: Christian Tanzer <tanzer <at> swing.co.at>

Date: Sun, 9 Nov 2014 18:40:05 UTC

Severity: normal

Found in version 24.4

Fixed in version 24.5

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

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 19003 in the body.
You can then email your comments to 19003 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#19003; Package emacs. (Sun, 09 Nov 2014 18:40:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Tanzer <tanzer <at> swing.co.at>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 09 Nov 2014 18:40:06 GMT) Full text and rfc822 format available.

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

From: Christian Tanzer <tanzer <at> swing.co.at>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4;
 Mouse-click in different frame displaying same buffer breaks region
Date: Sun, 09 Nov 2014 11:26:50 +0100
Starting point
===============

A buffer is displayed in two frames, a region was
selected with the mouse in one of the frames.

The problem
=============

If one clicks (mouse-1) into the other frame, the region is silently
extended to that point — although it isn't highlighted anymore.
A subsequent mouse-yank-primary inserts the broken region.

I originally noticed this problem when I used mouse-yank-primary to
yank a region into a different frame (without fist using mouse-1 to
select that frame).

For mouse-yank-primary, it can be solved by moving 

    (or mouse-yank-at-point (mouse-set-point click))

into the `let' for `primary'. I have no idea how to solve it for
mouse-1 events. 

Emacs versions effected
=========================

I originally noticed the problem in Emacs 24.1.
It's still there in 24.4.

The problem occurs, when starting from `emacs -Q'.




In GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.24)
 of 2014-10-22 on tr
Windowing system distributor `The X.Org Foundation', version 11.0.11500000
Configured using:
 `configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --libdir=/usr/lib64 --disable-silent-rules
 --disable-dependency-tracking --program-suffix=-emacs-24
 --infodir=/usr/share/info/emacs-24 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --with-gameuser=games --without-compress-install
 --with-file-notification=inotify --disable-acl --with-dbus
 --with-gnutls --with-gpm --without-hesiod --without-kerberos
 --without-kerberos5 --without-xml2 --without-selinux --without-wide-int
 --with-zlib --with-sound=alsa --with-x --without-ns --without-gconf
 --without-gsettings --with-toolkit-scroll-bars --with-gif --with-jpeg
 --without-png --with-rsvg --with-tiff --with-xpm --with-imagemagick
 --with-xft --without-libotf --without-m17n-flt --with-x-toolkit=gtk2
 GENTOO_PACKAGE=app-editors/emacs-24.4 'CFLAGS=-march=core2 -O2 -pipe'
 CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed''

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <down-mouse-4> 
<mouse-4> <double-down-mouse-4> <double-mouse-4> <triple-down-mouse-4> 
<triple-mouse-4> <triple-down-mouse-4> <triple-mouse-4> 
<triple-down-mouse-4> <triple-mouse-4> <triple-down-mouse-4> 
<triple-mouse-4> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <down-mouse-5> 
<mouse-5> <double-down-mouse-5> <double-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <down-mouse-5> 
<mouse-5> <double-down-mouse-5> <double-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <down-mouse-5> 
<mouse-5> <double-down-mouse-5> <double-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<down-mouse-4> <mouse-4> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <down-mouse-5> 
<mouse-5> <double-down-mouse-5> <double-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <down-mouse-5> <mouse-5> <double-down-mouse-5> 
<double-mouse-5> <help-echo> <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-1> <down-mouse-5> <mouse-5> 
<double-down-mouse-5> <double-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> 
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> 
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> 
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> <double-down-mouse-1> 
<double-mouse-1> <help-echo> <help-echo> <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> <down-mouse-2> 
<mouse-2> r e p o r t - C-_ M-x r e p o r t <tab> 
<return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
(No files need saving)
C-x <mouse-5> is undefined
byte-code: Beginning of buffer
Mark set
Undo!

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils time-date tooltip electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind inotify dynamic-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)

Memory information:
((conses 16 90242 9111)
 (symbols 48 17584 0)
 (miscs 40 62 139)
 (strings 32 9232 4284)
 (string-bytes 1 253117)
 (vectors 16 9031)
 (vector-slots 8 394987 16042)
 (floats 8 67 531)
 (intervals 56 4353 0)
 (buffers 960 13)
 (heap 1024 13846 595))

-- 
Christian Tanzer                                    http://www.c-tanzer.at/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19003; Package emacs. (Mon, 10 Nov 2014 22:56:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Christian Tanzer <tanzer <at> swing.co.at>
Cc: 19003 <at> debbugs.gnu.org
Subject: Re: bug#19003: 24.4;
 Mouse-click in different frame displaying same buffer breaks region
Date: Mon, 10 Nov 2014 17:55:03 -0500
> A buffer is displayed in two frames, a region was
> selected with the mouse in one of the frames.

> The problem
> =============

> If one clicks (mouse-1) into the other frame, the region is silently
> extended to that point — although it isn't highlighted anymore.

Actually, the region is extended as soon as you select the other frame
(if you have a window-manager that lets focus follow the mouse, then
you see it immediately).

So the problem is that this "switch-frame" should probably deactivate
the mark (if the region was set via shifted-movement).


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19003; Package emacs. (Tue, 11 Nov 2014 01:40:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Christian Tanzer <tanzer <at> swing.co.at>
Cc: 19003 <at> debbugs.gnu.org
Subject: Re: bug#19003: 24.4;
 Mouse-click in different frame displaying same buffer breaks region
Date: Mon, 10 Nov 2014 20:39:50 -0500
Would the patch below solve it for you?


        Stefan


=== modified file 'src/frame.c'
--- src/frame.c	2014-11-10 20:05:40 +0000
+++ src/frame.c	2014-11-10 22:55:38 +0000
@@ -1198,7 +1198,7 @@
   return do_switch_frame (frame, 1, 0, norecord);
 }
 
-DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e",
+DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "^e",
        doc: /* Handle a switch-frame event EVENT.
 Switch-frame events are usually bound to this function.
 A switch-frame event tells Emacs that the window manager has requested

=== modified file 'lisp/window.el'
--- lisp/window.el	2014-10-15 18:32:27 +0000
+++ lisp/window.el	2014-11-10 22:56:00 +0000
@@ -7904,7 +7904,7 @@
 
 (defun handle-select-window (event)
   "Handle select-window events."
-  (interactive "e")
+  (interactive "^e")
   (let ((window (posn-window (event-start event))))
     (unless (or (not (window-live-p window))
 		;; Don't switch if we're currently in the minibuffer.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19003; Package emacs. (Fri, 14 Nov 2014 11:29:01 GMT) Full text and rfc822 format available.

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

From: Christian Tanzer <tanzer <at> swing.co.at>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 19003 <at> debbugs.gnu.org
Subject: Re: bug#19003: 24.4;
 Mouse-click in different frame displaying same buffer breaks region
Date: Fri, 14 Nov 2014 11:28:22 -0000
Stefan Monnier wrote at Mon, 10 Nov 2014 20:39:50 -0500:

> Would the patch below solve it for you?

Yes, the patch in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19003#11
fixes the problem [tested against git branch emacs-24,
commit 6688117e7924].

With that patch in place, mouse-1 and mouse-2 work fine!

Thanks,

Christian

--
Christian Tanzer                                    http://www.c-tanzer.at/




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Sun, 16 Nov 2014 05:31:01 GMT) Full text and rfc822 format available.

Notification sent to Christian Tanzer <tanzer <at> swing.co.at>:
bug acknowledged by developer. (Sun, 16 Nov 2014 05:31:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Christian Tanzer <tanzer <at> swing.co.at>
Cc: 19003-done <at> debbugs.gnu.org
Subject: Re: bug#19003: 24.4;
 Mouse-click in different frame displaying same buffer breaks region
Date: Sun, 16 Nov 2014 00:30:50 -0500
Version:24.5

>> Would the patch below solve it for you?
> Yes, the patch in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19003#11
> fixes the problem [tested against git branch emacs-24,
> commit 6688117e7924].

Thanks, installed,


        Stefan




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

This bug report was last modified 10 years and 192 days ago.

Previous Next


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