all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 23478@debbugs.gnu.org, npostavs@users.sourceforge.net
Subject: bug#23478: 25.0.93; Mouse region selection asymmetry
Date: Mon, 04 Jul 2016 20:26:59 +0200	[thread overview]
Message-ID: <877fd16yz0.fsf@gmx.net> (raw)
In-Reply-To: <87bn2d736k.fsf@gmx.net> (Stephen Berman's message of "Mon, 04 Jul 2016 18:56:03 +0200")

On Mon, 04 Jul 2016 18:56:03 +0200 Stephen Berman <stephen.berman@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





  reply	other threads:[~2016-07-04 18:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-08 15:44 bug#23478: 25.0.93; Mouse region selection asymmetry Stephen Berman
2016-05-08 16:23 ` Eli Zaretskii
2016-05-08 18:31   ` Stephen Berman
2016-05-08 18:54     ` Eli Zaretskii
2016-05-08 19:41       ` Stephen Berman
2016-05-08 19:45         ` Eli Zaretskii
2016-07-02 23:16           ` npostavs
2016-07-03 14:33             ` Stephen Berman
2016-07-03 15:38               ` Eli Zaretskii
2016-07-03 22:24                 ` Stephen Berman
2016-07-04  2:38                   ` Eli Zaretskii
2016-07-04  8:45                     ` Stephen Berman
2016-07-04 14:57                       ` Eli Zaretskii
2016-07-04 16:56                         ` Stephen Berman
2016-07-04 18:26                           ` Stephen Berman [this message]
2016-07-05 17:23                           ` Eli Zaretskii
2016-07-06 16:40                             ` Stephen Berman
2016-07-06 18:44                               ` Eli Zaretskii
2016-07-07 12:08                                 ` Stephen Berman
2016-07-07 15:29                                   ` Eli Zaretskii
2016-07-07 16:22                                     ` Stephen Berman
2016-07-07 16:48                                       ` Eli Zaretskii
2016-07-07 17:02                                         ` Noam Postavsky
2016-07-07 17:16                                           ` Eli Zaretskii
2016-07-07 18:26                                           ` Stephen Berman
2016-07-08  9:58                                             ` Stephen Berman
2016-07-08 10:14                                               ` Eli Zaretskii
2016-07-08 15:38                                             ` Stephen Berman
2016-07-07 17:04                                         ` Stephen Berman
2016-07-04 15:29                       ` Drew Adams
2016-07-05  1:32                         ` npostavs

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

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

  git send-email \
    --in-reply-to=877fd16yz0.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=23478@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.