From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: putting double quotes efficiently Date: Tue, 04 Jun 2013 08:52:26 -0600 Message-ID: References: <878v2r19dy.fsf@panda.goosenet.in> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1370357522 9035 80.91.229.3 (4 Jun 2013 14:52:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Jun 2013 14:52:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 04 16:52:02 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ujsaf-0006cw-UJ for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jun 2013 16:52:02 +0200 Original-Received: from localhost ([::1]:57194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ujsaf-0001zs-Gv for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jun 2013 10:52:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjsaP-0001y7-43 for help-gnu-emacs@gnu.org; Tue, 04 Jun 2013 10:51:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjsaI-0004EY-NL for help-gnu-emacs@gnu.org; Tue, 04 Jun 2013 10:51:45 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:40293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjsaI-0004EE-Gu for help-gnu-emacs@gnu.org; Tue, 04 Jun 2013 10:51:38 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UjsaE-0006Fd-AD for help-gnu-emacs@gnu.org; Tue, 04 Jun 2013 16:51:34 +0200 Original-Received: from 71-212-228-63.hlrn.qwest.net ([71.212.228.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Jun 2013 16:51:34 +0200 Original-Received: from kevin.d.rodgers by 71-212-228-63.hlrn.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Jun 2013 16:51:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 71-212-228-63.hlrn.qwest.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 In-Reply-To: <878v2r19dy.fsf@panda.goosenet.in> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91293 Archived-At: On 6/3/13 9:50 AM, Udyant Wig wrote: > You might also try keyboard macros. > > Here's how I'd do it: > > 0. Move point to the first line (anywhere will do). > > print _!_line1 > print linetwo > print line3 > > 1. Press C-x ( to begin recording a keyboard macro > > 2. Press C-a to move to the beginning of the line > > _!_print line1 > print linetwo > print line3 > ... > 9. Press C-x ) to finish recording the keyboard macro > > 10. Press C-x e to repeat the keyboard macro > > print "line1"; > print "linetwo"; > print line3_!_ > > 11. You can now simply press `e' to repeat > > print "line1"; > print "linetwo"; > print "line3"; Or: Mark the remaining lines you want to change and `C-x C-k r' (apply-macro-to-region-lines). If you plan on doing that, you can move point to the beginning of the line before starting the keyboard macro definition and leave C-a out of the macro (because `C-x C-k r' will move to the beginning of each line automatically). -- Kevin Rodgers Denver, Colorado, USA