unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Alex <agrambot@gmail.com>, 23707@debbugs.gnu.org
Subject: bug#23707: 25.0.94; Regression in mouse-set-region
Date: Tue, 07 Jun 2016 11:10:04 +0200	[thread overview]
Message-ID: <57568F6C.8050707@gmx.at> (raw)
In-Reply-To: <87oa7ekxyl.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]

 > When using the mouse to set a region outside of the current window, the
 > region is now created improperly. There are two basic cases:
 >
 > a) dragging the mouse and ending on or outside the Emacs frame causes no
 > region to be created
 >
 > Steps to reproduce:
 >
 > 1. emacs -Q
 > 2. In the scratch buffer with <mouse-1>, drag the region and end off in
 > the menu-bar area.
 > 3. The region is not created.
 >
 > b) dragging the mouse and ending in another Emacs window causes a region
 > to be created between the starting point and the point corresponding to
 > the ending point *in the other buffer*.
 >
 > 1. emacs -Q
 > 2. C-x 2
 > 3. C-x 0
 > 4. In the bottom scratch window, drag with your mouse and end somewhere
 > in the scratch message int he top window
 > 5. The region is created, but ends prematurely at whatever point you
 > ended at in the top window.
 >
 >
 > Emacs 24.5 had the correct behaviour of creating a region between the
 > starting point and one of the ends of the buffer when dragging outside
 > of the current window.
 >
 > In GNU Emacs 25.0.94.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9)
 >   of 2016-05-17 built on lylat
 > Windowing system distributor 'Fedora Project', version 11.0.11803000
 > Configured using:
 >   'configure --with-gif=no'

Both scenarios are easily reproducible on Windows.  Would the attached
patch fix it for you?

Thanks, martin

[-- Attachment #2: mouse.diff --]
[-- Type: text/plain, Size: 767 bytes --]

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 592338a..64ee796 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -566,7 +566,12 @@ mouse-set-region
   (mouse-minibuffer-check click)
   (select-window (posn-window (event-start click)))
   (let ((beg (posn-point (event-start click)))
-	(end (posn-point (event-end click)))
+        (end
+         (if (eq (posn-window (event-end click)) (selected-window))
+             (posn-point (event-end click))
+           ;; If the mouse ends up in any other window or on the menu
+           ;; bar, use `window-point' of selected window (Bug#23707).
+           (window-point)))
         (click-count (event-click-count click)))
     (let ((drag-start (terminal-parameter nil 'mouse-drag-start)))
       (when drag-start


  reply	other threads:[~2016-06-07  9:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 17:51 bug#23707: 25.0.94; Regression in mouse-set-region Alex
2016-06-07  9:10 ` martin rudalics [this message]
2016-06-07 15:06   ` Eli Zaretskii
2016-06-08  6:33     ` martin rudalics
2016-06-08 16:42       ` Eli Zaretskii
2016-06-09  8:38         ` martin rudalics
2016-06-07 17:06   ` Alex
2016-06-07 17:19     ` Eli Zaretskii
2016-06-08  6:34     ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57568F6C.8050707@gmx.at \
    --to=rudalics@gmx.at \
    --cc=23707@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).