Macros Instead Of Elisp

Mario Jason Braganza has an interesting post that opened my eyes to another way of adapting Emacs to your workflow. I’m a programmer so my first impulse when I have a problem to solve with my workflow is to write a program. That works well for me. It works especially well with Emacs where it’s easy to write a quick function to sand down any friction with in my workflow.

The first thing Braganza did every morning was to manually configure Emacs to show his notes and agenda in a single frame but he wished there was a way to make this happen automatically. He realized that the easiest way to do that was to write a bit of Elisp but he had neither the the time nor the inclination to learn Elisp so he looked around for another way.

His solution was to do it by hand but record his steps as a keyboard macro. Then he could save the macro and simply replay it every morning to get his desired Emacs windows configuration. He had a couple of problems but eventually got everything working.

Like most experienced Emacs users, I often use keyboard macros to automate a one-off task but I never considered using them as a substitute for Elisp. Why would I? I can write Elisp but for those who can’t—and sometimes even for those who can—macros are a really nice way of automating some frequent task. It’s yet another way that Emacs adapts itself to its users rather than insisting those users adapt themselves to Emacs.

This entry was posted in General and tagged . Bookmark the permalink.