From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#38013: [PATCH] Rectangular region selection with mouse Date: Thu, 31 Oct 2019 17:12:24 -0700 (PDT) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="267170"; mail-complaints-to="usenet@blaine.gmane.org" To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 38013@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 01 01:13:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iQKYy-0017Kk-7U for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Nov 2019 01:13:12 +0100 Original-Received: from localhost ([::1]:55052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQKYw-0004QH-Fk for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Oct 2019 20:13:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50861) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQKYq-0004Q3-Op for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 20:13:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQKYo-0004q4-Di for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 20:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQKYo-0004pi-8w for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 20:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iQKYn-00019V-W1 for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 20:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Nov 2019 00:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38013 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 38013-submit@debbugs.gnu.org id=B38013.15725671614398 (code B ref 38013); Fri, 01 Nov 2019 00:13:01 +0000 Original-Received: (at 38013) by debbugs.gnu.org; 1 Nov 2019 00:12:41 +0000 Original-Received: from localhost ([127.0.0.1]:54503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQKYS-00018r-Ne for submit@debbugs.gnu.org; Thu, 31 Oct 2019 20:12:41 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:54194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQKYQ-00018a-46 for 38013@debbugs.gnu.org; Thu, 31 Oct 2019 20:12:38 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xA109H5i052932; Fri, 1 Nov 2019 00:12:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=Pt96tVA+p3BKZIjiX9acTN+CPqeRq8Rn7L7Zn1I8Kww=; b=b0Y9o7tGqKeNuDpbS3kBbozGVHmMTfLXyDzfNN3QCUKD0S/0YYqFMkos5dwgWnyKdaPN L1NvbTsuLcvzG4QH2G2juLrXnMC4Uc4WhR8RvZCb7eRRQdBFhkUi7EIz77kmQJQoWls4 3Ujb0wDEjsmUvOv9T3EwgQwOJeLxH1XqizCIr6kyzN8YJODVo/ZR5VppPv4KoXcm0Yu7 OSnMqIjK9ur+NSEV754M/cQxETp29emvMM4jTaZA7loPKwq/5COnQ8f4YCGGidKQPXYe w7Ec5jNEyQzGprw+yPWt/SRsOKBuRxM7lMpjk67OkfdOtXPr65Nx50Pt1z/ojbrbPIyF 8w== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2vxwhfxhcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 01 Nov 2019 00:12:27 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xA108kZR050746; Fri, 1 Nov 2019 00:12:27 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2vyv9h5h4y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 01 Nov 2019 00:12:27 +0000 Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xA10CPAO003480; Fri, 1 Nov 2019 00:12:25 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4900.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9427 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=807 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911010000 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9427 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=957 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911010000 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: 209.51.188.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:170568 Archived-At: > This is a proposal to add mouse-selection of rectangular regions. It > turns out to be useful; Emacs should come with the facility built-in. >=20 > The main problem is what to bind it to. The common modifiers (shift, > control, meta) are already taken. Platforms have different "standard" > modifiers: Option on macOS, Alt on Windows, Control in Gnome (?). >=20 > Assuming that the secondary selection is somewhat of an anachronism > which is likely to be less used today than the rectangular one would > be, the patch uses Meta as default modifier. Both secondary and > rectangular mouse selection have defcustoms permitting easy change. >=20 > The defaults could be different, for example if secondary mouse > selection turns out to be very popular. > There is no documentation yet. FWIW - 1. I like the general idea of being able to use the mouse to directly define a rectangular region. _Good initiative_. 2. But I disagree completely that the secondary selection is an anachronism. IMO it is not used as much as it could (and should and would) be used in Emacs only because it has no _keyboard_ bindings, by default. I use C-M-y to do all of this:=20 * yank the secondary (no pref arg) * select the secondary as the region (pref arg =3D 0) * move the secondary to the region (pref arg > 0) * swap the secondary and the region (pref arg < 0) The 3rd and 4th of those set the secondary with just the keyboard - from the region. Another way to set it using just the keyboard is to use C-x C-M-SPC to start it and C-x C-M- to end it. (And I use C-M-y during Isearch to yank the secondary to the end of the search string.) The secondary selection is different from the region. Its advantage, and its disadvantage, is that it is liberated from point - it need not even be currently visible in a window. It doesn't change just because you move the cursor around. The region has a ring, `kill-ring', to let you get previous selections. I do the same thing for the secondary selection, as well - give it a ring. And if the previous command yanked the secondary then M-y yank-pops the secondary ring (not the kill-ring), to replace that yank with the previous secondary on the ring. https://www.emacswiki.org/emacs/SecondarySelection#second-sel.el