File Templates in Emacs

Jeremy Friesen has to write a weekly summary of his team’s work. That summary has a fixed format so management provided a template for it. Being an Emacs user, Friesen, of course, wanted to write his report in Emacs.

He wrote a bit of Elisp that allowed him to insert the template into and Emacs buffer and configure the buffer. This is a common need and other Emacs users may want to do something similar. Friesen writes his report in Markdown so he sets the buffer with the template to markdown-mode. Other Emacs users may prefer to use something else such as Org-mode but it’s easy to tweak his code to do that.

All of this can be done “manually”, of course, but having everything wrapped up in a single function streamlines your workflow and makes day-to-day chores easier. If you’re like me, you probably have several things like this: simple multistep tasks that you could easily automate but just haven’t bothered to. I find that after a while I reach a threshold where I think, “It’s crazy that I keep doing this by hand all the time, I’m going to automate it.” The sad thing is that it takes me so long to reach that threshold.

The real message of Friesen’s post is not about templates but about automating those simple tasks that seem like they’re not worth the effort until they do.

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