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: Sun, 08 May 2016 20:31:04 +0200 Message-ID: <87wpn4wgev.fsf@gmx.net> References: <878tzky2oe.fsf@gmx.net> <83eg9cecy2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1462732353 13062 80.91.229.3 (8 May 2016 18:32:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 May 2016 18:32:33 +0000 (UTC) Cc: 23478@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 08 20:32:21 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 1azTUx-0002SA-Mx for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 May 2016 20:32:12 +0200 Original-Received: from localhost ([::1]:37686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azTUw-0007AA-Uq for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 May 2016 14:32:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azTUt-00077t-Me for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 14:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azTUo-0008Mg-Fy for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 14:32:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azTUo-0008MR-CB for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 14:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1azTUo-0006dL-0U for bug-gnu-emacs@gnu.org; Sun, 08 May 2016 14:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 May 2016 18:32: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: Original-Received: via spool by 23478-submit@debbugs.gnu.org id=B23478.146273227625445 (code B ref 23478); Sun, 08 May 2016 18:32:01 +0000 Original-Received: (at 23478) by debbugs.gnu.org; 8 May 2016 18:31:16 +0000 Original-Received: from localhost ([127.0.0.1]:43438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azTU4-0006cL-K0 for submit@debbugs.gnu.org; Sun, 08 May 2016 14:31:16 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:63757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azTU2-0006c7-UM for 23478@debbugs.gnu.org; Sun, 08 May 2016 14:31:15 -0400 Original-Received: from rosalinde ([89.245.107.13]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Lugbo-1bhR7L0Pxo-00zr6P; Sun, 08 May 2016 20:31:07 +0200 In-Reply-To: <83eg9cecy2.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 May 2016 19:23:17 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) X-Provags-ID: V03:K0:BuhGFyw1D4oqjPEkUmSkavDZZjKNPoejD0JvDpizKNsqWq5orH8 awWlLPlhv1U5YG8h6s3cUAPyJKCsEKqD01z1JRNndq4UUUZV42IvdYVSZGBCWIYTdgHjQ2e s7wLaOyhIfKjGMWjhwOVEuqqSOxYpS/i+DOiPl4VIfo1FYv2o2tnQn9kv+AdRBOJJMLAYNA bNeVKK3lQSxHU0nQYQs5Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:1HYIM0alZjQ=:yFKbPDXO1w0sDa1sH8tkd0 DRg98/Ih45YR3ec/E3matrZO8W8sWXfj4/rmrre4srxbFjeJ8ztprEuLy2zp4YzJae5QV+xOk hiOaUpJYyyFS7zdMjOJgscgU/c5je/gIf8c2JFUtOoTj9a2b73oOj6gWPJu5AuWrn/FD7e5tR iB/b7wd0ZpxGBoUP4T9Xj17oTrnOwUMLsmBJ2w1S+WVilsrxp8lO7ExO0wzie+pcu2C07V7Jn laE6lcLv2qc6E8omfPvxEGE7nuNLArP177ZLyS2SbQni7ELMv3PdDh/k4w1l045mhmIpsI9o9 RaFbAbq+Kur6x39ZYN+fFIJk/seRdEQQ1YX9j8bGLuqa5TWDUnvmMAzjlMCOXWrwZ0Xr6fc2h /Oo72OgGOhGpxslVi1pNvhhoOzJ5ZYjia6i0aGVdoJp117E9Q4RvM7UCiiegoqhv0Pq07F1Mm 1z37wDDKT8+8PGEU2WUCHrS18VVG/IPPSYKtTQenl4tB2C51q1go9Drgg1lIrZcbKmq9JT7kt jEUTpCJQ+RUKKlDpAkIPwKTz19r/69EVzTOqzGEUXaOhGQq8rZdLdpLJMC5uF9L6QKYNCese8 +yO3nO8i7o+reRRKlkWG+y1L8UwfYVSNLZ/T9QJDDhLBTrpV8XhHhkAHphJq3oaHk8X8hLIjV CkgcaGgk+P5eJSu6iGzAhkvV7JOwGTQajQa9reckS6nvie3iQ39nWlM9LXSLcOeNr5xRyUPbz 93I7b1ED0QGo9DeUlQfWTPceYOZWUc1iFyj3euNk7OGOkgwBhQxCaWylNES8etL/Icyf7RWq 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:117987 Archived-At: On Sun, 08 May 2016 19:23:17 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Date: Sun, 08 May 2016 17:44:49 +0200 >> >> 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. > > Isn't this because Emacs always makes sure point is visible, but > there's no such requirement about the mark? I'm sure it is. > If I type "C-x C-x" after > item 5 in your recipe, the entire region becomes visible, as expected. Yes, and you also see the whole region when you type `S-C-M-b' on `)' in step 5 instead of double clicking on it, because backward-sexp changes point, but double-clicking does not (or rather, it puts point one position after region-end). >> 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. > > I don't think calling 'recenter' is TRT. First, the fact that you see > the display recentering after item 3 in your recipe is only the > default behavior; if you set scroll-conservatively to 101 before > repeating your recipe, you will see that Emacs instead scrolls the > display just one line, i.e. the minimum amount required to bring point > back into view. Users that set scroll-conservatively like that will > lynch us if we recenter display in this situation. Good point, I think I had that vaguely in mind when I expressed my doubts about `recenter', but couldn't remember just what needed to be taken account of. I did try an alternative to `recenter', using `goto-char' instead, which changes point and hence induces recentering by redisplay, but it also loses the region highlighting. I tried (with several variants involving redisplay-highlight-region-function and redisplay--update-region-highlight) but failed to figure out how to keep the highlighting, but if that's a better way to handle this, maybe someone more familiar with the region highlighting code will be able to do that. > Bottom line, I don't think we should behave like that by default. I > think this could be an optional feature, but it must obey > scroll-conservatively (and maybe also other related variables). Definitely. Thanks for the feedback. Steve Berman