Some Custom Emacs Functions That Are Changing My Game

I have some new, magic commands in Emacs that have become very dear to me in my daily workflow. As you all know, my focus is producing written content, not programming, so these functions were designed to help with that. As always, I don’t share the code because it was mostly produced with language models and my own tinkering, and while they work for me, I can’t vouch for the quality.

Also, these functions are specific to my workflow, so they may not apply to your system. I will share the ideas in case they trigger ideas for you.

Additionally, I’d like to know how you’re using Emacs to solve everyday logistical problems in your work. Feel free to comment below the post.

“Office Export” Function With Template Selection

As I mentioned above, I use Org Mode for writing documents: articles, blog posts, fiction, and virtually anything else I need to write.

One of the key benefits of writing in plain text, and with a markup syntax like Org Mode, is that I can write one document and export it to multiple other types of documents. Every destination for a piece of writing demands a slightly different deliverable format. It can often be difficult, or downright dizzying, to keep track of the unique specifications of different publications.

Writing for the Internet, I can usually do a simple HTML export, but sometimes Google Docs is expected.

For fiction writing, different publications may want the standard manuscript format (12-point, double-spaced, Times New Roman font) or something unique to their own editorial processes. Instead of having to format and re-format in LibreOffice, I’ve set up templates for publications I submit to regularly. So I just run my offfice-export function, and it asks me some questions, with yes or no prompts, and then prompts me to select which template I want to use.

The point is not only to save a few minutes of time here and there, or to be lazy, but also to avoid errors that will inevitably happen with constant formatting changes. One simple export from a master document simplifies the whole process.

Org Mode Jump

There is an existing function for jumping around an Org Mode document. I wrote my function to do something similar. My org jump function prints out all my headings (with their tags) in the minibuffer, and I can select one to “jump” to. With the heading and the tag, and with orderless completion installed, I can easily filter for exactly which heading I want, jump to it, make any edits I need to make, and then jump back to where I was before. This saves me from a lot of needless scrolling in a longer document.

I really like how the function preserves the syntax highlighting:


I want to do a video covering these functions. However, I have been plugging away daily at National Novel Writing Month and sending out new short stories for prospective publication. Videos will return soon. If you’d like to receive occasional updates from me, you can  subscribe here.

1 Comment

  1. Love to see what you did with the templates. I have used pandoc to export org mode to a particular docx file when I need to, but usually I just use the default pdf via LaTeX option.
    For Org jump, I have been using consult-outline that I bound to “M-s o”. It shows the headings formatted and tags too.

    FYI, I saw this post on my Elfeed source: Planet Emacslife

Leave a Reply

Your email address will not be published.


*