From: Drew Adams <drew.adams@oracle.com>
To: gebser@mousecar.com, GNU Emacs List <help-gnu-emacs@gnu.org>
Subject: RE: purpose and usage of secondary-selection ???
Date: Tue, 13 Sep 2016 13:23:54 -0700 (PDT) [thread overview]
Message-ID: <22657eef-7ce6-4df6-b8dd-f74eb0c5ca1c@default> (raw)
In-Reply-To: <6a48016d-42bd-54ea-44c6-8dbf10fae885@mousecar.com>
> Sometimes while typing on my laptop I accidentally brush against the
> touchpad and inadvertantly mess up something. Today, while not even
> emacs, this happened, affecting what happened in an emacs frame which
> previously didn't even have the focus.
>
> What I ended up in that emacs frame was that a random section of text
> was set to background yellow. Investigating further, I found that text
> with the yellow background was a secondary-selection. But I couldn't
> find anything in the Help screens describing anything about it, except
> its properties. So here are my questions:
>
> What is/are the purpose(s) of a secondary-selection?
>
> What can be done with a secondary-selection...? and how to do them?
>
> How do I undo this secondary-selection... i.e., make the selection go
> away without changing the file/buffer in any way?
1. Emacs Wiki is your friend:
https://www.emacswiki.org/emacs/SecondarySelection
2. Its characteristics tell you its advantages and disadvantages.
a. It is separate from the region. So you have two pieces of text you
can paste/yank.
b. It is unrelated to point (the cursor position). The region always has
point as one of its end positions (mark is the other end).
3. A good use case: Selective replacement of things (same thing or
different things) with the same text. Select some text, then yank
the secondary selection. Repeat - anywhere; any text to replace.
You cannot do this with the region text, because as soon as you
select the text to replace you've redefined the region, and so
also the text to yank.
4. For the secondary selection to really be useful, IMHO, you need to
bind yanking it to a keyboard key, not just to a mouse action.
5. Library `second-sel.el' can help make the secondary selection
more useful.
https://www.emacswiki.org/emacs/SecondarySelection#secondary-sel.el
6. See the Emacs manual, node `Secondary Selection' for more info.
http://www.gnu.org/software/emacs/manual/html_node/emacs/Secondary-Selection.html
7. To make the secondary selection empty ("get rid of it"): Click
`M-mouse-1' (don't drag).
next prev parent reply other threads:[~2016-09-13 20:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-13 19:15 purpose and usage of secondary-selection ??? ken
2016-09-13 20:23 ` Drew Adams [this message]
2016-09-13 21:34 ` Michael Heerdegen
-- strict thread matches above, loose matches on Subject: below --
2016-09-16 16:55 ken
2016-09-16 17:14 ` Kaushal Modi
2016-09-16 17:48 ` ken
2016-09-16 18:18 ` Kaushal Modi
2016-09-16 18:31 ken
2016-09-16 19:38 ` Drew Adams
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=22657eef-7ce6-4df6-b8dd-f74eb0c5ca1c@default \
--to=drew.adams@oracle.com \
--cc=gebser@mousecar.com \
--cc=help-gnu-emacs@gnu.org \
/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.
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).