From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ken Newsgroups: gmane.emacs.help Subject: RE: purpose and usage of secondary-selection ??? Date: Fri, 16 Sep 2016 14:31:04 -0400 Message-ID: <818624dd-425a-8a1b-6362-6e555685cc2f@mousecar.com> Reply-To: gebser@mousecar.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1474050750 25553 195.159.176.226 (16 Sep 2016 18:32:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Sep 2016 18:32:30 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 To: GNU Emacs List Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 16 20:32:21 2016 Return-path: Envelope-to: geh-help-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 1bkxvw-0005ML-RK for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Sep 2016 20:32:20 +0200 Original-Received: from localhost ([::1]:43169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxvx-0007c8-9O for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Sep 2016 14:32:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxuw-0007ZC-1G for help-gnu-emacs@gnu.org; Fri, 16 Sep 2016 14:31:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkxuq-00075M-Ur for help-gnu-emacs@gnu.org; Fri, 16 Sep 2016 14:31:17 -0400 Original-Received: from mout.perfora.net ([74.208.4.197]:53866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkxuq-000754-NM for help-gnu-emacs@gnu.org; Fri, 16 Sep 2016 14:31:12 -0400 Original-Received: from nv.mousecar.net ([96.27.75.237]) by mrelay.perfora.net (mreueus002) with ESMTPSA (Nemesis) id 0MDffU-1bmYbZ23oc-00H8rw for ; Fri, 16 Sep 2016 20:31:11 +0200 Original-References: X-Provags-ID: V03:K0:iZJ4pK1J/Ac+uQC/ED5eRmBrl16t2UhmJ6zxRA5ee8HczzC3L/K Udrdp2ShYw2i2PKUmEJLIKsiuVluoHaKjc2CFOFi1kA93NiTH0zmlA9vHiGNmd6fXMiEAQc ZTd552r91KjlORY9PE+Djx3cWWGQJ+Vnwlj+lb6L/oIPzTHkFy7ZaOgt0Mq+D4CwHcjkI+j W7zWU36qfWcPHI8twKZSA== X-UI-Out-Filterresults: notjunk:1;V01:K0:lUdBAt8Vb/U=:6FIzE5LLU9FUMhK867Z/wg oVfjus8LPOGb9QyeOMtgZImPEGCOFoZKV6DoenuTwP3NcQODv5fVoUvDz56JM8qKGO3wGSQ5K fsv4lc47iKYplFB4+y9f391gaUaXSNl96oV9RTQ6Xku4LBMRe7QGwqGl9tJTRzlf7IEetbnMo RMhtIBpFf9a9aiyhTJKIeyXp6yMQ4KPO/BziHi/SMbmFPQQh6ijbthhTSrWjhqEjWHHWuDvze uaa+S3P0TBMY3hbjzxsTnprQEnvgMxOZAXR9AemEaR6rF+/AQM4xxU3jMdWpiI8yQB9FYrLf/ foL3TFhjlfWXzhjgU38TQ8LGE+KYLH6dhdyFcQDzE+/vBQg/zkiM8+kcGlIlc4pYIHPaaDu+h r6OVYIIa+z46OVIT4nMLbz+n8RtAvq1wsu7roFc7JFC4dLBTg3WzXifuRZvE9QwaRmg1eEt/o q3n2fzY/blF9m0p4O9IxJEgoJ0w6o7Y6XfLiYNc4rjgnqx32M8WuIvcJlG9WJnTwaHhqa3m/W +WQXA6bQDoZOf9ljavbtV3cNAQyPr9hBAjJV3mmD/bQmGH3wopjC0HcssWJYhFpNhOdhN2jXK m+wCpidPuS6Gw1/vzXFzCY7o45ZWPAIiFCqZl6DpS5u1MabfYa4d6gqb6NLsZQaGfbzKAw9Az X4R9VDWLLkKKXMVL7b/1uvpnQXJN5zMA34pOm7XfrmUPdU6VRUwzidmjbMCTO02JcmGf8BUsY 964F+2cb9ulJrHv7 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 74.208.4.197 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111348 Archived-At: > >/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. :)