From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rajinder Yadav Newsgroups: gmane.emacs.help Subject: Re: copying text into a paste buffer as you type? Date: Thu, 16 Dec 2010 13:07:50 -0500 Message-ID: <4D0A5576.3040509@gmail.com> References: <4D09F0EF.5030601@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292522926 27503 80.91.229.12 (16 Dec 2010 18:08:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Dec 2010 18:08:46 +0000 (UTC) Cc: 'emacs-help' 10 Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 16 19:08:42 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PTIFt-0005BR-3D for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 19:08:41 +0100 Original-Received: from localhost ([127.0.0.1]:45203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTIFs-0005Iv-Ai for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 13:08:40 -0500 Original-Received: from [140.186.70.92] (port=53131 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTIF9-0005Hp-NQ for help-gnu-emacs@gnu.org; Thu, 16 Dec 2010 13:07:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTIF7-0005lC-FL for help-gnu-emacs@gnu.org; Thu, 16 Dec 2010 13:07:55 -0500 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:59509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTIF7-0005l3-Co for help-gnu-emacs@gnu.org; Thu, 16 Dec 2010 13:07:53 -0500 Original-Received: by yxl31 with SMTP id 31so2106711yxl.0 for ; Thu, 16 Dec 2010 10:07:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=/6UribpH/un6NJY5/KAt1ekCiEojniIaDXrw9gqjWh0=; b=nfqcvZn5GJ0oLMWIgoHzFMOsya9bNmg3PD0Umf3K/sAr9qsTgzyt3vJbualsg64N3x kdPAHQ7sO4f1uEsehAdVmhsVLj/rthgWaTi2nC50UtbK83McS0bGvLLHbQFCOFEHlGgo yOmD7Q80Z40TEtxADcPI2UiK9yf4hlgdeKsTo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; b=KYH3F4kYYdNdkkkajjQ0RB3O+aax2DPZRU7h1noGitAoP1B+mJpzwzzm4QG1xUFFUR A75Zx1WEUfrpuN2xhaoI/S07mWox7o+CmyAZgFqDxLxEakEvtw3bPIlwMbIFv2TN9fy/ 3K3rXQZaBpKCxA5G+zwTRaJ/krnr+fgYIsfSk= Original-Received: by 10.100.55.10 with SMTP id d10mr5512618ana.179.1292522872143; Thu, 16 Dec 2010 10:07:52 -0800 (PST) Original-Received: from [192.168.2.100] (dsl-173-248-230-235.acanac.net [173.248.230.235]) by mx.google.com with ESMTPS id j14sm3093696anb.39.2010.12.16.10.07.50 (version=SSLv3 cipher=RC4-MD5); Thu, 16 Dec 2010 10:07:51 -0800 (PST) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77596 Archived-At: On 10-12-16 11:49 AM, Drew Adams wrote: >> is there a way to get emacs to copy text into a paste buffer as you >> type? for example, I would like to type 'null => false' once >> and be able to paste into the other lines >> >> t.string :title, null => false >> t.string :name, null => false >> t.text :post, null => false > > Yes, but you have to tell it when to start and stop copying. > > C-SPC n u l l => f a l s e C-x C-x C-x C-x M-w > > Start: > `C-SPC' Mark selection beginning. > Type text. > Stop: > `C-x C-x' Activate selection, swapping mark and point. > `C-x C-x' Swap mark and point back again. > `M-x' Copy selection to kill-ring (paste buffer). > > Then `C-y' to yank (paste) it. > > --- > > If you want to paste the same text multiple times but still be able to select > other text without interfering with what you saved (copied), use the secondary > selection: To select and copy for the secondary selection: drag `mouse-1' with > the Meta key depressed. To yank it: `M-mouse-2'. > > This is particularly useful for replacing selected text here and there (esp. in > delete-selection mode). E.g., double-click `mouse-1' on a sexp to select it, > then `M-mouse-2' to replace it. So instead of using `query-replace' you can use > it to change selected occurrences of `null => false' to `hopalong cassidy'. > > http://www.emacswiki.org/emacs/SecondarySelection > > An alternative to using the secondary selection is to use `M-y', perhaps > multiple times, just after you yank (`C-y'). That cycles through previous > kill-ring entries until you get to the one you want. > Drew, that works great, although I think you meant 'M-w' instead of 'M-x', thanks! -- Kind Regards, Rajinder Yadav