From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: copying text into a paste buffer as you type? Date: Thu, 16 Dec 2010 08:49:26 -0800 Message-ID: References: <4D09F0EF.5030601@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292518243 2552 80.91.229.12 (16 Dec 2010 16:50:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Dec 2010 16:50:43 +0000 (UTC) To: "'Rajinder Yadav'" , "'emacs-help'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 16 17:50:39 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 1PTH2M-0003l5-Sr for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 17:50:39 +0100 Original-Received: from localhost ([127.0.0.1]:56406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTH2M-0005PP-E9 for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Dec 2010 11:50:38 -0500 Original-Received: from [140.186.70.92] (port=35825 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTH1f-0005NO-6j for help-gnu-emacs@gnu.org; Thu, 16 Dec 2010 11:49:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTH1d-00079A-9v for help-gnu-emacs@gnu.org; Thu, 16 Dec 2010 11:49:54 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:50000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTH1d-000796-3c for help-gnu-emacs@gnu.org; Thu, 16 Dec 2010 11:49:53 -0500 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oBGGnnhv027136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Dec 2010 16:49:50 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oBGGndNE016932; Thu, 16 Dec 2010 16:49:40 GMT Original-Received: from abhmt002.oracle.com by acsmt353.oracle.com with ESMTP id 881294631292518168; Thu, 16 Dec 2010 08:49:28 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Dec 2010 08:49:27 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcudEHW0VIZgtExyT5CLYeKeoFML6QALHXbA In-Reply-To: <4D09F0EF.5030601@gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:77594 Archived-At: > 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.