Emacs macro trick
I don’t know when this was added, but as someone who has used Emacs pretty constantly since 1985, I can’t believe I never knew this. Most people know you can record a simple macro with C-x ( to start and C-x ) to end. You can then replay it back with C-x e. Nothing new there, right? Well, obviously you can combine the C-u prefix, which will repeat it. So C-u 10 C-x e will execute the macro 10 times. If you say C-u 0 before, then it’ll run until it has an error (usually the end of the file, or something).
But here’s the trick. If you type C-u C-x e, it will run the macro once, and then allow you simply to press e to keep running it. This is very handy when you’re trying to go through a list in the middle of a document.
Funny how I never noticed.
This entry was posted at 11:28 am on 7 September 2009 and is filed under Programming. You can follow any responses to this entry through the post-specific RSS 2.0 feed.
No comments found.
Both comments and pings are currently closed.