help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: putting double quotes efficiently


From: Kevin Rodgers
Subject: Re: putting double quotes efficiently
Date: Tue, 04 Jun 2013 08:52:26 -0600
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

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]