unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* purpose and usage of secondary-selection ???
@ 2016-09-13 19:15 ken
  2016-09-13 20:23 ` Drew Adams
  2016-09-13 21:34 ` Michael Heerdegen
  0 siblings, 2 replies; 9+ messages in thread
From: ken @ 2016-09-13 19:15 UTC (permalink / raw)
  To: GNU Emacs List

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?


Thanks much.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: purpose and usage of secondary-selection ???
  2016-09-13 19:15 ken
@ 2016-09-13 20:23 ` Drew Adams
  2016-09-13 21:34 ` Michael Heerdegen
  1 sibling, 0 replies; 9+ messages in thread
From: Drew Adams @ 2016-09-13 20:23 UTC (permalink / raw)
  To: gebser, GNU Emacs List

> 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).



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: purpose and usage of secondary-selection ???
  2016-09-13 19:15 ken
  2016-09-13 20:23 ` Drew Adams
@ 2016-09-13 21:34 ` Michael Heerdegen
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Heerdegen @ 2016-09-13 21:34 UTC (permalink / raw)
  To: ken; +Cc: GNU Emacs List

ken <gebser@mousecar.com> writes:

> What is/are the purpose(s) of a secondary-selection?
>
> What can be done with a secondary-selection...? and how to do them?

It's just a secondary...selection, not much different from the primary
one.  The main purpose is, I think, to provide an interface to the
secondary selection some window systems provide.  If your window system
doesn't support a secondary selection, it's not of much use per se in
Emacs.  But some people like having another separate selection, and as
already has been mentioned, you can develop nice personal
working/editing styles around it.  But it can do nothing that could not
be achieved in other ways - if more or less comfortably is mostly a
matter of taste and your Emacs configuration (for example, your value of
`mouse-yank-at-point', if you have a good mean to get "back where I had
been before" etc.) and your working habits.

I used to use secondary selections some time ago, but then I stopped
using it because it sucked that I could not access it from outside
Emacs, so I found ways to substitute it with other stuff (like
"smart-yank.el").

Michael.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* purpose and usage of secondary-selection ???
@ 2016-09-16 16:55 ken
  2016-09-16 17:14 ` Kaushal Modi
  0 siblings, 1 reply; 9+ messages in thread
From: ken @ 2016-09-16 16:55 UTC (permalink / raw)
  To: GNU Emacs List

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?


Thanks much.

Note: I sent this same email to the group on Tuesday, but it never 
showed.  Has the server been down?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: purpose and usage of secondary-selection ???
  2016-09-16 16:55 purpose and usage of secondary-selection ??? ken
@ 2016-09-16 17:14 ` Kaushal Modi
  2016-09-16 17:48   ` ken
  0 siblings, 1 reply; 9+ messages in thread
From: Kaushal Modi @ 2016-09-16 17:14 UTC (permalink / raw)
  To: gebser, GNU Emacs List

It showed. You also got a reply.

On Fri, Sep 16, 2016, 12:56 PM ken <gebser@mousecar.com> wrote:

> 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?
>
>
> Thanks much.
>
> Note: I sent this same email to the group on Tuesday, but it never
> showed.  Has the server been down?
>
> --

Kaushal Modi


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: purpose and usage of secondary-selection ???
  2016-09-16 17:14 ` Kaushal Modi
@ 2016-09-16 17:48   ` ken
  2016-09-16 18:18     ` Kaushal Modi
  0 siblings, 1 reply; 9+ messages in thread
From: ken @ 2016-09-16 17:48 UTC (permalink / raw)
  To: GNU Emacs List

Hmmm.  I searched both my Inbox and Spam/Junk folder and found neither 
my own post or the reply. That's very strange.

On 09/16/2016 01:14 PM, Kaushal Modi wrote:
>
> It showed. You also got a reply.
>
>
> On Fri, Sep 16, 2016, 12:56 PM ken <gebser@mousecar.com 
> <mailto:gebser@mousecar.com>> wrote:
>
>     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?
>
>
>     Thanks much.
>
>     Note: I sent this same email to the group on Tuesday, but it never
>     showed.  Has the server been down?
>
> -- 
>
> Kaushal Modi
>



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: purpose and usage of secondary-selection ???
  2016-09-16 17:48   ` ken
@ 2016-09-16 18:18     ` Kaushal Modi
  0 siblings, 0 replies; 9+ messages in thread
From: Kaushal Modi @ 2016-09-16 18:18 UTC (permalink / raw)
  To: gebser, GNU Emacs List

You can check the thread online:
http://lists.gnu.org/archive/html/help-gnu-emacs/2016-09/msg00108.html

I noticed that Drew are replied to you and this mailing list. So you either
deleted this email by mistake or it went to spam?

On Fri, Sep 16, 2016 at 2:08 PM ken <gebser@mousecar.com> wrote:

> Hmmm.  I searched both my Inbox and Spam/Junk folder and found neither
> my own post or the reply. That's very strange.
>
> On 09/16/2016 01:14 PM, Kaushal Modi wrote:
> >
> > It showed. You also got a reply.
> >
> >
> > On Fri, Sep 16, 2016, 12:56 PM ken <gebser@mousecar.com
> > <mailto:gebser@mousecar.com>> wrote:
> >
> >     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?
> >
> >
> >     Thanks much.
> >
> >     Note: I sent this same email to the group on Tuesday, but it never
> >     showed.  Has the server been down?
> >
> > --
> >
> > Kaushal Modi
> >
>
> --

Kaushal Modi


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: purpose and usage of secondary-selection ???
@ 2016-09-16 18:31 ken
  2016-09-16 19:38 ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: ken @ 2016-09-16 18:31 UTC (permalink / raw)
  To: GNU Emacs List

> >/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).

Whoever thought of and whoever maintains the list archives, thanks. I 
found my post there, as well as two replies.  Above is one which is very 
helpful.  Thanks, Drew.

I'll be doing some reading on this and playing around with it.  I like 
the fact that a secondary-selection's region is highlighted and that the 
highlighting doesn't follow the point around, that a region can be 
marked and *stays marked* while I move around within the file/buffer 
looking for something else, e.g., the place I want to move the region 
to.  I hope to find other helpful uses for it.

tnx++

PS (to developers): It would be nice if the emacs menus had some mention 
of secondary-selection, maybe some of its very basic functionality.  Not 
a big fan of mousing around in text processors or editors, but sometimes 
a menu can give a clue when I don't have one. :)




^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: purpose and usage of secondary-selection ???
  2016-09-16 18:31 ken
@ 2016-09-16 19:38 ` Drew Adams
  0 siblings, 0 replies; 9+ messages in thread
From: Drew Adams @ 2016-09-16 19:38 UTC (permalink / raw)
  To: gebser, GNU Emacs List

> PS (to developers): It would be nice if the emacs menus had some mention
> of secondary-selection, maybe some of its very basic functionality.  Not
> a big fan of mousing around in text processors or editors, but sometimes
> a menu can give a clue when I don't have one. :)

Please consider sending enhancement suggestions to the Emacs
developers, by doing `M-x report-emacs-bug' (that is also for
enhancements).

Wrt your menu idea:

There are few vanilla-Emacs commands that involve the secondary
selection.  Those that do exist I cannot imagine being useful
on a menu.

But I do agree with you that it can be helpful to discover
commands by exploring menus.

Library `second-sel.el' offers some more secondary-selection
commands, and some of them can be useful on a menu.  Library
`menu-bar+.el' adds these to the `Edit' menu, after `Paste':

 `Paste Secondary'
 `Move Secondary to Region'
 `Swap Region and Secondary'
 `Select Secondary as Region'

https://www.emacswiki.org/emacs/MenuBarPlus



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-09-16 19:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-16 16:55 purpose and usage of secondary-selection ??? ken
2016-09-16 17:14 ` Kaushal Modi
2016-09-16 17:48   ` ken
2016-09-16 18:18     ` Kaushal Modi
  -- strict thread matches above, loose matches on Subject: below --
2016-09-16 18:31 ken
2016-09-16 19:38 ` Drew Adams
2016-09-13 19:15 ken
2016-09-13 20:23 ` Drew Adams
2016-09-13 21:34 ` Michael Heerdegen

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).