From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#23478: 25.0.93; Mouse region selection asymmetry Date: Thu, 07 Jul 2016 14:08:32 +0200 Message-ID: <878txd7irj.fsf@gmx.net> References: <878tzky2oe.fsf@gmx.net> <83eg9cecy2.fsf@gnu.org> <87wpn4wgev.fsf@gmx.net> <8360uoe5ye.fsf@gnu.org> <87shxswd5s.fsf@gmx.net> <834ma8e3ll.fsf@gnu.org> <871t3bhbpz.fsf@users.sourceforge.net> <87poqun63w.fsf@gmx.net> <83furqratc.fsf@gnu.org> <87h9c6mkb0.fsf@gmx.net> <83vb0mp1ok.fsf@gnu.org> <87wpl17pvs.fsf@gmx.net> <83eg79pi29.fsf@gnu.org> <87bn2d736k.fsf@gmx.net> <83furongms.fsf@gnu.org> <87r3b6btyi.fsf@gmx.net> <83poqqli77.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467893368 12262 80.91.229.3 (7 Jul 2016 12:09:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2016 12:09:28 +0000 (UTC) Cc: 23478@debbugs.gnu.org, npostavs@users.sourceforge.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 07 14:09:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bL87G-0005pl-V9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jul 2016 14:09:15 +0200 Original-Received: from localhost ([::1]:39436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL87F-0004kQ-V0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jul 2016 08:09:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL875-0004kE-6p for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2016 08:09:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bL873-00056D-Q2 for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2016 08:09:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL873-000569-Mo for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2016 08:09:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bL873-0002aH-JO for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2016 08:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jul 2016 12:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23478 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23478-submit@debbugs.gnu.org id=B23478.14678933369918 (code B ref 23478); Thu, 07 Jul 2016 12:09:01 +0000 Original-Received: (at 23478) by debbugs.gnu.org; 7 Jul 2016 12:08:56 +0000 Original-Received: from localhost ([127.0.0.1]:40304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL86x-0002Zu-SC for submit@debbugs.gnu.org; Thu, 07 Jul 2016 08:08:56 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:53620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL86w-0002Zg-2Y for 23478@debbugs.gnu.org; Thu, 07 Jul 2016 08:08:54 -0400 Original-Received: from rosalinde ([89.245.112.189]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M7Hao-1bWl6t1NMk-00x0PJ; Thu, 07 Jul 2016 14:08:33 +0200 In-Reply-To: <83poqqli77.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 06 Jul 2016 21:44:44 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-Provags-ID: V03:K0:wbK/J16GarebAZKhxi66d3RGl6bV291wRJoHXzF9Z2oMuCACdXl Z1yxRjmhVbphMG61s2Kvvc/ZAwgpu95g6DwuNErbQS8SYlDsxmlIJQWgB6tIkO+LP7HvYAZ BzJ4iDoyOmjI7600QAw4U9bec+UK33hVi5HE3jY60qsAn5yco+ilvSNk6fhj5u4NlXPiEiM YNrdTeSTP6wj+ni5k0qsw== X-UI-Out-Filterresults: notjunk:1;V01:K0:dkox32ODBQA=:3BBBoTTzEWQnauPBzkMhl7 5pOL0/evTiLd/xJ7KBx6fGTDl38PodHur0cUaIYOnjfQdhh8j/BgZswgqDh4X1qwePv+ds1Dz deat+YPuhV5e1Wcb3AegkJ7TYA8otHzMNDhqn/zO7lCcvXM3esvmWGl+n0tSuBujlyuFaP4LW d1Ut7wp9m1dDdJFvzcrVQXFyMD3ZDE+AkHee3gX/7OGfP7U1A8XZJwN0gF+0T+ejvh5Elmpnq 1ZOpPN+AMvgrAkuYI9/LUVMmaYsvJ3+A7kNxf0UohzyTGWj6EHKzsaXPoPYMXp1Fs4f64Fg4M +h0ovQIfuzHWrnRL3UnZ85SPfalEVOGZGpsnPyWTdEspdZiQJlQkkyOlunmIgizbCTx9mji/X /V2uJZDPIIU4QILWjpXaFjQbk3QvXrYN0Frq7FfLZh5md9kONBxoQ5veMkMSaFz/lf+7x/BTi SG7aA9Uu5Mr/+EvJKkR74cPh9SvcsiD+wct+5JjixWFnzPriyKkAgQ+MITeaOT0kEwQjcm0wO RZnJNIu784fojXAfN1wCEJ8OTYYABl+kSjOBaNp2pfyusPQtHwEvC0dAuC4B9SuNjbVwwsFKA B1WPMYkEvwwy1600+colqEWWfNUs0jHLCW61pTCLBkRSxGI6204SE7yWy63u4PooIkiojR7+n mlUSVsUlMduNMFVeQSfn4vlKkLSSvcfws6zZ46NCUmZi8vTRvuKzoHdHg1WHAr3W2hC/vFwom fYZ80omujksi4EXW0Hj7h+5kNU64EFFz+uqAr+99763TqwKLKqZUxWAUBjlx6qnlZ2CDoD5B X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120564 Archived-At: On Wed, 06 Jul 2016 21:44:44 +0300 Eli Zaretskii wrote: >> From: Stephen Berman > >> So the user option would specify the behavior when selecting a >> region which extends backward from point, providing a choice between >> (i) the current behavior (as default), which leaves point at the >> position of the click and does not scroll backward if the region >> extends above window-start; and (ii) the new behavior, which moves >> point to region-beginning, scrolling if the region extends above >> window-start (the new behavior is thus the mirror image of the >> current behavior when selecting a region which extends forward from >> point). > > Yes, that's what I had in mind. > >> Here is a patch implementing this: >> >> diff --git a/lisp/mouse.el b/lisp/mouse.el >> index 8d72753..2f9ff6b 100644 >> --- a/lisp/mouse.el >> +++ b/lisp/mouse.el >> @@ -540,15 +540,31 @@ mouse-drag-vertical-line >> (interactive "e") >> (mouse-drag-line start-event 'vertical)) >> >> +(defcustom mouse-select-region-backward nil > > I'd name it mouse-select-region-scroll-backward. Using "scroll" in the name suggests that the main purpose of this variable is to control scrolling backward, but it only controls the final position of point, and scrolling is a by-product of that which only happens if necessary. Given that, do you still prefer to have "scroll" in the name? >> But note that, prior to the patch in my previous post, what was under >> discussion as the new behavior was different: namely, scrolling if the >> region extends above window-start but leaving point at the position of >> the click. This is a sort of compromise between the current behavior >> and that in (ii), and it could be a third choice for the user option. > > I have no opinion about this. Please do what you feel is better. If nobody objects I'll go with the binary rather than the ternary option, because of the display issues with the latter that I noted, and the former is also simpler both in implementation and conceptually. > This will also need a NEWS entry, and also please see if the > description of mouse-set-point in the Emacs manual needs an update. In that node ("Mouse Commands") there is no mention of the current behavior of double clicking mouse-1, but there is a partial description in the node "Word and Line Mouse". There is also a cross-reference in "Mouse Commands" to "Word and Line Mouse" in connection with mouse-3. I think a cross-reference in connection with mouse-1 is also appropriate, and a description of the new user option should go in the latter node. What do you think of the following? diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 7e60062..231989f 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -97,7 +97,8 @@ Mouse Commands invoked by clicking with the left mouse button, @kbd{mouse-1}, in the text area of a window. This moves point to the position where you clicked. If that window was not the selected window, it becomes the -selected window. +selected window. You can also activate a region by double-clicking +mouse-1 (@pxref{Word and Line Mouse}). @vindex x-mouse-click-focus-ignore-position Normally, if the frame you clicked in was not the selected frame, it @@ -215,7 +216,7 @@ Word and Line Mouse @table @kbd @item Double-mouse-1 -Select the text around the word which you click on. +Select the text around the word or character which you click on. Double-clicking on a character with symbol syntax (such as underscore, in C mode) selects the symbol surrounding that character. @@ -226,6 +227,17 @@ Word and Line Mouse constant (Emacs uses heuristics to figure out whether that character is the beginning or the end of it). +Double-clicking on the beginning of a parenthetical grouping or +beginning string-delimiter moves point to the end of the region, +scrolling the buffer display forward if necessary to show the new +location of point. Double-clicking on the end of a parenthetical +grouping or string-delimiter keeps point at the end of the region by +default, so the beginning of the region will not be visible if it is +above the top of the window; setting the user option +@code{mouse-select-region-scroll-backward} to non-nil changes this to +make point move to the beginning of the region, scrolling the display +backward if necessary. + @item Double-Drag-mouse-1 Select the text you drag across, in the form of whole words. One somewhat embarassing aspect of describing this option is that is makes the default asymmetrical behavior painfully obvious without providing a rationale for it (and I don't know of any). I suppose we could add "for historical reasons" after "by default".... Steve Berman