From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#27530: patch to cut and copy secondary Date: Thu, 29 Jun 2017 06:41:55 -0700 (PDT) Message-ID: <9cdc1ecc-d9b2-46fa-a044-fccc27ab1696@default> References: <20170629.214304.1822535652145654069.tkk@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1498743799 17137 195.159.176.226 (29 Jun 2017 13:43:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Jun 2017 13:43:19 +0000 (UTC) To: Tak Kunihiro , 27530@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 29 15:43:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQZiv-00040N-T5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 15:43:10 +0200 Original-Received: from localhost ([::1]:39442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQZj1-0002P0-46 for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 09:43:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQZit-0002Nu-67 for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 09:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQZio-0002EH-AR for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 09:43:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40925) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQZio-0002Dt-6X for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 09:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dQZin-0004pa-NN for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 09:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Jun 2017 13:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27530-submit@debbugs.gnu.org id=B27530.149874372818500 (code B ref 27530); Thu, 29 Jun 2017 13:43:01 +0000 Original-Received: (at 27530) by debbugs.gnu.org; 29 Jun 2017 13:42:08 +0000 Original-Received: from localhost ([127.0.0.1]:43602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQZhw-0004oJ-Db for submit@debbugs.gnu.org; Thu, 29 Jun 2017 09:42:08 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:47606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQZht-0004nm-Sd for 27530@debbugs.gnu.org; Thu, 29 Jun 2017 09:42:06 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v5TDfwmJ015116 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Jun 2017 13:41:59 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v5TDfw9B032003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Jun 2017 13:41:58 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v5TDfuLj002833; Thu, 29 Jun 2017 13:41:56 GMT In-Reply-To: <20170629.214304.1822535652145654069.tkk@misasa.okayama-u.ac.jp> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6770.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] 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:134023 Archived-At: > I found secondary can be used as another region. Good initiative. (But another "selection", not another region.) And a selection that is (obviously) not affected by the cursor position. It persists even as you move the cursor. That's the main difference from the region (advantages, disadvantages). > Here I send a patch to cut and copy secondary as if region > (when region does not exist). FWIW, I suggested similar things to Emacs devel long ago. I use the secondary selection a *lot*. See https://www.emacswiki.org/emacs/second-sel.el, https://www.emacswiki.org/emacs/SecondarySelection#second-sel.el You might want to consider incorporating some or all of what is there. I and others have been using it since 2008. IMO, the first, and simplest, improvement to add to Emacs is a way to create and yank the secondary selection using only the keyboard, not the mouse. My guess is that the reason more users do not use the secondary selection is that there are no keyboard keybindings for it. > +(defun mouse-secondary-exists-p () > + "Return location of mouse-secondary-overlay when exists in current > buffer." Name probably shouldn't end in `-p' if the return value is mainly not a Boolean. Non-nil here means overlay limits. > +(defun mouse-set-mark-and-point-from-secondary () Cf. `secondary-to-primary'. > +(defun mouse-set-secondary-from-region () Cf. `primary-to-secondary'. `second-sel.el' also gives the secondary selection its own history, `secondary-selection-ring', analogous to `kill-ring'. HTH.