emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#23478: closed (25.0.93; Mouse region selection asy


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#23478: closed (25.0.93; Mouse region selection asymmetry)
Date: Fri, 08 Jul 2016 15:40:02 +0000

Your message dated Fri, 08 Jul 2016 17:38:50 +0200
with message-id <address@hidden>
and subject line Re: bug#23478: 25.0.93; Mouse region selection asymmetry
has caused the debbugs.gnu.org bug report #23478,
regarding 25.0.93; Mouse region selection asymmetry
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
23478: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23478
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.0.93; Mouse region selection asymmetry Date: Sun, 08 May 2016 17:44:49 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux)
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.  To reproduce:

0. emacs -Q
1. C-h t M-g M-g 42 RET (to open the English Emacs Tutorial and put
   point on line 42).
2. C-l C-l C-l (to make line 42 the last visible line in the window).
3. Double click with mouse-1 on the `(' before "hold" in line 42.
=> The display is recentered and the region between `(' on line 42 and
   `)' on line 43 is selected and highlighted.
4. C-a C-l C-l (to clear the selection highlighting and make line 43 the
   first visible line in the window).
5. Double click with mouse-1 on the `)' after "key" in line 43.
=> Line 43 is highlighted but remains the first visible line in the
   window and the part of the region on line 42 is not visible.

This is not a program bug, since Emacs is behaving as intended, but it
is a UX asymmetry that I think it would be preferable to eliminate.  The
patch below does that, but I'm not sure it's the best way to handle
this, since I don't know whether calling `recenter' from Lisp may have
undesirable side effects that the automatic recentering Emacs redisplay
does when point moves out of the visible portion of the window does not
have.

diff --git a/lisp/mouse.el b/lisp/mouse.el
index fa355ff..c3efefe 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -531,7 +531,10 @@ 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))
+         (recenter)))
     ;; 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))))


In GNU Emacs 25.0.93.5 (x86_64-suse-linux-gnu, GTK+ Version 3.14.15)
 of 2016-05-08 built on rosalinde
Repository revision: cd27f7396b77086b6c02eff5b2648bfba439d264
Windowing system distributor 'The X.Org Foundation', version 11.0.11601000
System Description:     openSUSE 13.2 (Harlequin) (x86_64)

Configured using:
 'configure --with-xwidgets 'CFLAGS=-Og -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XWIDGETS

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix



--- End Message ---
--- Begin Message --- Subject: Re: bug#23478: 25.0.93; Mouse region selection asymmetry Date: Fri, 08 Jul 2016 17:38:50 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
On Thu, 07 Jul 2016 20:26:06 +0200 Stephen Berman <address@hidden> wrote:

> I'll push the changes to master as soon as I get a chance (hopefully
> tomorrow).

Done as commit d0c0b71 and closing this bug.

Steve Berman


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]