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 18:56:03 +0200	[thread overview]
Message-ID: <87bn2d736k.fsf@gmx.net> (raw)
In-Reply-To: <83eg79pi29.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Jul 2016 17:57:18 +0300")

On Mon, 04 Jul 2016 17:57:18 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: npostavs@users.sourceforge.net,  23478@debbugs.gnu.org
>> Date: Mon, 04 Jul 2016 10:45:43 +0200
>> 
>> > Let's make one step back and describe the exact change in behavior
>> > with the last patch, OK?  Maybe some of us (e.g., me) don't really
>> > understand what is the change.
>> 
>> It simply makes selecting a region by double-clicking with the mouse
>> more uniform; as I wrote in my OP, the current behavior is this:
>> 
>>    When you select a region by double-clicking with mouse-1 and the end
>>    of the region is below the last visible line of the window, Emacs
>>    recenters the display, making the entire selected region visible
>>    (unless it's larger than half the window's height).  But when you
>>    select a region by double-clicking with mouse-1 and the beginning of
>>    the region is above the first visible line of the window, Emacs does
>>    not recenter the display, so the entire selected region is not
>>    visible.
>> 
>> With the patch the behavior is now simply this:
>> 
>>    When you select a region by double-clicking with mouse-1, Emacs
>>    recenters the display, making the entire selected region visible
>>    (unless it's larger than half the window's height).
>> 
>> To me (and I think Noam agrees), this is the behavior I would expect,
>> while the current behavior is less user-friendly; I can't think of a
>> reason why anyone would dislike the new behavior or prefer the current
>> behavior, but maybe someone can provide a use case.
>
> Thanks, I wanted to be sure I understand the change correctly.
>
> This is indeed a change in behavior: the display recentering in the
> second situation might be undesirable, since some text that was
> previously visible might become invisible.  

But (more of) the text that is selected by mouse-click becomes visible;
surely that's more desirable, don't you think?  And again, that makes
the second situation more like in the first situation, which also seems
desirable.

>                                             And what will happen if
> the region is larger than the window can show?

Part of the region simply won't be displayed in the window, which is
nothing new: the same thing that currently happens in the first
situation.

> In the first situation, the mouse click actually moves point, so the
> scrolling that may follow is expected.  Not so in the second case.

Actually, it's easy to get this in the second situation: just call
exchange-point-and-mark once:

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?

> So I still think we should default to the old behavior.

Even with the above adjustment?  Although three of the four opinions
that have been voiced in this thread have been in favor of just having
the new behavior (though that was prior to the above adjustment), I will
defer to your decision, or if you wish, ask John to settle it.  And to
be clear, whatever the decision on a user option and concomitant default,
I would rather install the above patch, where point moves, than the
version where point does not move.

Steve Berman





  reply	other threads:[~2016-07-04 16:56 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 [this message]
2016-07-04 18:26                           ` Stephen Berman
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=87bn2d736k.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.