GNU bug report logs - #23478
25.0.93; Mouse region selection asymmetry

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Sun, 8 May 2016 15:46:02 UTC

Severity: minor

Tags: patch

Found in version 25.0.93

Done: Stephen Berman <stephen.berman <at> gmx.net>

Bug is archived. No further changes may be made.

Full log


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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 23478 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#23478: 25.0.93; Mouse region selection asymmetry
Date: Mon, 04 Jul 2016 20:26:59 +0200
On Mon, 04 Jul 2016 18:56:03 +0200 Stephen Berman <stephen.berman <at> gmx.net> wrote:

> diff --git a/lisp/mouse.el b/lisp/mouse.el
> index 8d72753..39adc42 100644
> --- a/lisp/mouse.el
> +++ b/lisp/mouse.el
> @@ -548,7 +548,11 @@ mouse-set-point
>    (interactive "e\np")
>    (mouse-minibuffer-check event)
>    (if (and promote-to-region (> (event-click-count event) 1))
> -      (mouse-set-region event)
> +      (progn
> +        (mouse-set-region event)
> +        (when (> (window-start) (region-beginning))
> +	  (exchange-point-and-mark)
> +	  (sit-for 0)))
>      ;; Use event-end in case called from mouse-drag-region.
>      ;; If EVENT is a click, event-end and event-start give same value.
>      (posn-set-point (event-end event))))
>
> This makes the bevavior even more like the first situation (i.e., the
> mirror image of it).  So I like this solution even better.  What do you
> think?

That patch only mirrors the first situation when the region begins above
the window; the following always changes point when clicking at what
will be the end point of the region, so this fully mirrors the first
situation, and would be the most symmetrical behavior (unless I'm
overlooking something):

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 8d72753..608a52f 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -548,7 +548,11 @@ mouse-set-point
   (interactive "e\np")
   (mouse-minibuffer-check event)
   (if (and promote-to-region (> (event-click-count event) 1))
-      (mouse-set-region event)
+      (progn
+        (mouse-set-region event)
+        (when (> (posn-point (event-start event)) (region-beginning))
+	  (exchange-point-and-mark)
+	  (sit-for 0)))
     ;; Use event-end in case called from mouse-drag-region.
     ;; If EVENT is a click, event-end and event-start give same value.
     (posn-set-point (event-end event))))

Steve Berman




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

Previous Next


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