TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Learn Emacs: Keyboard Macros

61 pointsby binarysoulover 13 years ago

5 comments

drblastover 13 years ago
There have been various times in my programming career that I've wanted an emacs macro with arguments, so that it would do things like concatenate a number in each line. Things like this in C:<p><pre><code> #define a 0 #define b 1 ... #define l 10 #define m 11 </code></pre> Usually I take that as a sign that I need to write some other program to generate the lines of the C program, but for some tasks that's overkill and I want an automated way to create a list of sequential things so I don't have to type 1 down 1 down 1 down 1 down 2 down 2 down 2 down...<p>Surely this is a solved problem.
评论 #3220654 未加载
评论 #3220548 未加载
评论 #3220961 未加载
评论 #3220534 未加载
评论 #3220890 未加载
评论 #3221202 未加载
评论 #3220727 未加载
评论 #3220568 未加载
评论 #3224389 未加载
评论 #3221491 未加载
ryanwatkinsover 13 years ago
Each time I consider trying another IDE, I turn on the sometimes available "use emacs keybindings" feature.<p>Then I quickly remember I use the macro feature constantly and back I go to Emacs.
hollerithover 13 years ago
Long-time Emacs user here. (When I search for a string, read, send or reply to an email, or set a timer to tell me when my eggs are ready, I use an Emacs command I wrote.)<p>I just want to say that if you plan to learn how to write commands in Emacs Lisp, you do not need to learn how to define or use keyboard macros. In my experience, it is always easier just to write some lisp.
评论 #3221749 未加载
agumonkeyover 13 years ago
On the tangent, this may be the 10th article of this kind i've seen, the 1st time it was nice to discover macro shortcuts, now I feel something is wrong.<p>Emacs documentation is large and well written, yet we discover features with google, it's not even centralized, let's avoid duplication of efforts and reinforce emacswiki. Maybe integrating emacswiki with the standard emacs distribution in some way ? (if it's not done already.. which would render this little rant finally funny)
评论 #3221767 未加载
评论 #3220904 未加载
binarysoulover 13 years ago
disclaimer: I'm the author<p>Any suggestions for other emacs topics I should blog about?<p>Thanks for your interest.
评论 #3220878 未加载
评论 #3220852 未加载