Why I Love org-mode

Łukasz M.

Earlier, I wrote a post about how I enjoy using Emacs as my text editor of choice. Obviously, I cited its extensibility as one of the main factors. However, I did not really elaborate on what that brings to the table in terms of actual functionality. So, in this post I would like to make a little showcase of a thing about Emacs which I absolutely love; namely, org-mode.

What IS org-mode?

If you, the reader, do not already know about org-mode, I am going to assume that you also don’t know about Emacs. According to its own website, org-mode is “A GNU Emacs major mode for keeping notes, authoring documents, computational notebooks, literate programming, maintaining to-do lists, planning projects, and more — in a fast and effective plain text system.”1. A “major mode” is basically a set of rules that determine the editing behaviour of a given buffer in Emacs2. So, org is essentially a markup with an Emacs mode that prettifies everything and adds additional functionality. From its description, it seems like a pretty robust feature set, and, it really is. At first glance it may seem almost too good to be true.

A Markup Language

The whole is enabled by a plain-text markup language. Most people should be familiar with HTML or markdown as prime examples of such languages. While org might be superficially similar to its contemporaries, it is conceptually different. As others have already pointed out, it has one of the best syntaxes. That makes it simpler than HTML. Additionally, it is standardised, unlike markdown.

The org markup consists of a tree of headings:

* This is a heading
Text under a heading
** This is subheading
Lists under a heading:
- One
- Two
Lists can be numbered, etc:
1. This is a list item
2. This is another list item

And of course, as I am showing it in plain text, it does not look as pretty as it does in a text editor. But don’t fret, whenever one opens an org file in Emacs, org-mode is automatically activated and the display of the plain text is prettified, and may further be changed to ones liking. Furthermore, the headlines can be moved up and down (with the text below them), indented, folded, etc. by keybindings. This makes org a great outliner, as one may structure one’s thinking as a tree.

Other examples of syntax include:

* TODO This is a todo heading
* This is a headline with a scheduled date
SCHEDULED: <2023-02-12 Sun>
And so on, and so forth.

As you can see, we can make to-do items, schedule.

There is also support for source code blocks:

#begin_src python
def func() :
    print("Hello world!")
#end_src

One may execute them, get the results in the file itself and even “tangle” them into a file which makes for an amazing literate programming environment.

Furthermore, org has the capability to typeset math with LaTeX:

\(e := \sum_{j=0}^{\infty} \frac{1}{j!}\)

There are also links, footnotes, references… Almost everything you can hope for. And it is all incredibly intuitive and, most importantly, human-readable.

I think I have given a sufficient taste of its markup capabilities, let’s move on to some more fun and mind-blowing features.

A Scheduler

Org-mode is so named due to its great scheduling capabilities. There is an agenda view, which essentially gathers all the to-do, scheduled, timestamped, etc. items from certain files and gives you a schedule for a given day and/or tasks that need to be done. One may also clock-in items (measure the time spent on a task), create habitual tasks which will repeat after a given period of time and much more. This goes beyond the syntax, and into the actual mode that runs on top of Emacs.

Extensibility

Due to Emacs’ nature, org-mode is extensible, and there are a lot of packages that build on top of its infrastructure and expand its ecosystem. I am a big fan of org-roam, which lets one create a Zettelkasten system for notes such that files are linked by automatically generated identifiers built into org-mode.

Write Once, Export to Any Format

When one has written a document, outline, whatever, in org-mode, one may export it to almost any file format known to humanity, including this here blog. There are LaTeX exports, markdown, HTML, you name it. In fact, I am writing in org-mode right now and exporting to markdown for the Hugo static site generator.

Furthermore, by the nature of plain text, org notes last. Proprietary formats often go out of style or have shoddy backwards compatibility. I am fairly confident, that I will still be able to open my notes in twenty to fifty years, this of course excluding any natural disaster. Nevertheless, one may easily typeset by any of the aforementioned formats and print hard copies of one’s notes if one requires redundancy.

Conclusions

I have never seen such a wide capability markup language nor a scheduler or to-do list; especially not in one package; let alone this extensible and open source. With the strong ecosystem of Emacs featuring extensible text-editing, it is a great tool for a variety of purposes. I have just scratched the surface of org-mode, but I hope it has been enough to pique your interest and showcase why I love it so much. Please refer to the org-mode website if you are interested to get into it yourself.


  1. Org Mode Website ↩︎

  2. Major Modes (Emacs Manual) ↩︎