unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>, rpluim@gmail.com
Cc: 27530@debbugs.gnu.org
Subject: bug#27530: patch to cut and copy secondary
Date: Tue, 5 Sep 2017 06:53:48 -0700 (PDT)	[thread overview]
Message-ID: <a17933c5-e49a-419a-a22a-cd62c9e50cd1@default> (raw)
In-Reply-To: <20170905.182537.2023575934474224469.tkk@misasa.okayama-u.ac.jp>

> 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' (= 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-<return>") '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.





  parent reply	other threads:[~2017-09-05 13:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 12:43 bug#27530: patch to cut and copy secondary Tak Kunihiro
2017-06-29 13:41 ` Drew Adams
2017-07-01  0:45   ` Tak Kunihiro
2017-08-01  1:35     ` Tak Kunihiro
2017-09-05  3:11 ` Tak Kunihiro
2017-09-05  7:51   ` Robert Pluim
2017-09-05  9:25     ` Tak Kunihiro
2017-09-05  9:32       ` Robert Pluim
2017-09-05 12:22         ` Tak Kunihiro
2017-09-05 13:53       ` Drew Adams [this message]
2017-09-05 23:17         ` Tak Kunihiro
2017-09-06  0:29           ` Drew Adams
2017-09-05 15:08   ` Eli Zaretskii
2017-09-05 23:06     ` Tak Kunihiro
2017-09-06  2:33       ` Eli Zaretskii
2017-09-06  3:42         ` Tak Kunihiro
2017-09-06 16:04           ` Eli Zaretskii
2017-09-07 12:35             ` Tak Kunihiro
2017-09-07 19:11               ` Eli Zaretskii
2017-09-07 23:02                 ` Tak Kunihiro
2017-09-08  8:27                   ` Eli Zaretskii
2017-09-10  3:01                     ` Tak Kunihiro
2017-09-11  2:03                       ` Tak Kunihiro
2017-09-20  7:55                         ` Eli Zaretskii
2017-09-20 12:39                           ` Tak Kunihiro
2017-09-21  8:32                             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a17933c5-e49a-419a-a22a-cd62c9e50cd1@default \
    --to=drew.adams@oracle.com \
    --cc=27530@debbugs.gnu.org \
    --cc=rpluim@gmail.com \
    --cc=tkk@misasa.okayama-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).