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: Tue, 5 Sep 2017 06:53:48 -0700 (PDT) Message-ID: References: <20170629.214304.1822535652145654069.tkk@misasa.okayama-u.ac.jp> <20170905.121104.688310267504171014.tkk@misasa.okayama-u.ac.jp> <87pob5bn1t.fsf@gmail.com> <20170905.182537.2023575934474224469.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 1504619671 24496 195.159.176.226 (5 Sep 2017 13:54:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 5 Sep 2017 13:54:31 +0000 (UTC) Cc: 27530@debbugs.gnu.org To: Tak Kunihiro , rpluim@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 05 15:54:17 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 1dpEIx-0005gn-Cj for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Sep 2017 15:54:15 +0200 Original-Received: from localhost ([::1]:59054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpEJ4-0005D8-AK for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Sep 2017 09:54:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpEIo-0005Bv-Lo for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2017 09:54:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpEIj-00065q-TW for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2017 09:54:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpEIj-00065l-Py for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2017 09:54:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dpEIj-0002d6-J7 for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2017 09:54: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: Tue, 05 Sep 2017 13:54: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: patch Original-Received: via spool by 27530-submit@debbugs.gnu.org id=B27530.150461964010101 (code B ref 27530); Tue, 05 Sep 2017 13:54:01 +0000 Original-Received: (at 27530) by debbugs.gnu.org; 5 Sep 2017 13:54:00 +0000 Original-Received: from localhost ([127.0.0.1]:50641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpEIi-0002cq-3w for submit@debbugs.gnu.org; Tue, 05 Sep 2017 09:54:00 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:48899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpEIg-0002cb-SR for 27530@debbugs.gnu.org; Tue, 05 Sep 2017 09:53:59 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v85DrqYa004327 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Sep 2017 13:53:52 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v85Drpe6013177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Sep 2017 13:53:52 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v85Drntp016916; Tue, 5 Sep 2017 13:53:49 GMT In-Reply-To: <20170905.182537.2023575934474224469.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.6774.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] 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:136602 Archived-At: > The function exchanges point and mark. > When there is region, this also creates secondary. Why? What if I want to just exchange point and mark, and not also copy the region to the secondary? > When there is secondary, this converts secondary > to primary in advance. What if I don't want to do that? I don't like the sound of this. The point of having a secondary selection is to keep it separate from the region or primary selection. `C-x C-x' should affect only the region, not the secondary selection. There is nothing wrong with having commands that do the kinds of things you describe - I've long had similar, as you know. What is not good, I think, is to confuse the two wrt key bindings. Please choose different bindings. > As a consequence, an user sees the function exchanges > - `point' and `mark' > - `point and mark' (=3D primary) and secondary > at the same time. My suggestion is to please keep such functionality separate. ---- FWIW, I've been using secondary, swapping it with primary, etc. for a long time. I make sure, in second-sel.el, to suggest key bindings that keep things separate. (global-set-key (kbd "C-M-y") 'secondary-yank|select|move|swap) (define-key esc-map "y" 'yank-pop-commands) (global-set-key (kbd "C-x C-M-SPC") 'set-secondary-start) (global-set-key (kbd "C-x C-M-") 'secondary-save-then-kill) (define-key isearch-mode-map (kbd "C-M-y") 'isearch-yank-secondary) The single key `C-M-y' (just suggested, not done by second-sel.el) does all of this: Yank the secondary selection. With a prefix arg, interact with region. Prefix arg: None: Yank secondary. Zero: Select secondary as region. > 0: Move secondary to region. < 0: Swap region and secondary. Details: No prefix arg: Yank the secondary selection at point. Move point to the end of the inserted text. Leave mark where it was. Zero arg: Select the secondary selection and pop to its buffer. Non-zero arg: Move the secondary selection to this buffer's region. Negative arg: Also go to where the secondary selection was and select it as the region. That is, swap the region and the secondary selection. Yes, the command mixes behavior for the region and the secondary selection. But it does so only when you use a prefix arg. And it does so only on a new key binding (`C-M-y'), not on a binding long associated with the mark and the region (`C-x C-x'). The command and key are specifically for the secondary selection.