An Ode to Emacs. The Greatest Operating System
My text editor for life
Emacs is one of those magical pieces of technology that manages to bridge the gap between being a tool that does useful work, and becoming a deeply personal component in a software developer’s life. It is one half of the editor war and is one of the longest running examples of programmers elevating their personal choices to moral imperatives. But beyond that, it is also a piece of software that has seen decades of iteration. It’s old enough that parts of it were contributed by people that have long since passed. They may be gone, but their code still lives on, making our lives just a bit easier.
I started using Emacs six years ago in January of 2017. At the time I was in my first year of my Bioinformatics Master’s program at Boston University. I had finished my first semester and had just begun working on my internship. Up until that point, my entire programming career had been in Python in a Jupyter notebook. My project was on Huntington’s disease patients, and a lot of the work I would do required editing Python files on a remote server. This was extremely inconvenient to do on a Jupyter notebook so I started shopping around for a better tool. My boss used Vim so that was the obvious choice. I tried it out for a few days but found its modal editing cryptic and confusing. Almost immediately as I would Google how to do this or that in Vim, I started coming across posts that mentioned Emacs. Very soon I was deep into the lore of the editor wars and I was lured over.
The first time I loaded it up I was greeted with the standard
*About GNU Emacs* buffer with all of its helpful, eye searingly white glory.
I sped through the tutorial, and promptly forgot almost everything it taught me. Those first few weeks were nothing short of disastrous. I constantly forgot essential key chords, inadvertently triggered unfamiliar Emacs states, and wreaked havoc on the configuration, only to be clueless about fixing it. You name it and I’ve probably experienced it. But the look of betrayal on my boss’s face the first day I fired up Emacs in front of him put a smile on my face, like a defiant child plunging his arms elbow deep into mud despite parental warnings. While using spite as a motivator for choosing a text editor is not recommended, I must admit that, at that time, I embraced Emacs partly to rebel against the "establishment." Hey I was in a poor mental state during my time in grad school. I needed this. I have a great lasting relationship with my mentor to this day, so no lasting harm was done at least.
After about a month of persistence, I finally gained the ability to navigate, save, and exit Emacs reliably. I even managed to figure out how to close the message buffer that would occasionally pop up, when I made mistakes or executed certain commands. No longer did I have to resort to hard quitting Emacs. Around this time, I discovered the versatility of Emacs. Not only could I edit files locally on my computer or in the terminal while connected to our cluster, but I could also edit them directly on Emacs using tramp. This allowed me to maintain all the fancy customizations I had painstakingly crafted on my laptop while simultaneously editing the bioinformatics pipeline in the cloud. The moment I realized I could split my buffer into two windows, utilizing the second one to navigate the cluster through a terminal built within Emacs, I was hooked. It dawned on me that Emacs was more than just a text editor, it was a complete computing environment. And it had its share of amusing, if not quirky, features like M-x tetris (with the Alt key serving as Meta in Emacs), M-x doctor, and M-x zone. Although not the most practical features, they harkened back to a time in computing when things weren't so serious, when geeks simply wanted to make computers do whimsical things and have a good laugh.
As I became more familiar with Emacs I started understanding the memes.
And yes, I actually did become more productive. The more I delved into Emacs, the more I realized its boundless capabilities. It could do far more than I ever imagined. Yet, therein lies Emacs's greatest strength and weakness, it can do almost anything. To someone first exposed to its power, it's an exhilarating realization. Reading emails and IRC, effortlessly navigating directories in the cross platform terminal eshell, and seamlessly zipping around a Python file, all while still catching glimpses of your sexy anime waifu wallpaper through Emacs's transparent window, make you feel like a wizard. However, if all you require is text editing, I'd actually discourage using Emacs. It’s a fine text editor, don’t get me wrong, but if you really have no desire to do anything to configure it, use some of it’s more advanced features, and make it work for you, it’s overkill. But you probably also drive a car like this right?
For everyone else Emacs is a goated text editor. Org mode allows you to journal, make todo lists, export to various file formats with pandoc, and even create presentations.
Want to read the documentation that is up to date for your version of Emacs, including any custom variables and key bindings you may have set? Run
M-x info or type
Need documentation on your documentation? Click or hit enter over the Info link while in the info buffer. Does something bother you about your Emacs config? Learn Elisp and modify your init.el file. Love Elisp so much that you want to use it as a general purpose programming language outside of Emacs? Use Guile Scheme in Elisp mode.
Want to use Emacs as the window manager for your operating system, of course you can do that. There is a reason why one of the old Emacs logos is a kitchen sink.
People have gotten Emacs to do lots of things in its over 47 year history. And if you have any questions, there is probably someone who has been using it longer than you’ve been alive that can answer it. With so much it can do, learning Emacs seems like an impossible task. Indeed, when talking about the learning curve of Emacs, this is a popular graph that often shows up in the comments.
As someone who uses Emacs daily I can attest that this is indeed an accurate depiction of Emacs’ learning curve. There are major modes in Emacs with enough functionality that you could teach a college level class on them. But I’ve found that anything I’ve worked on that has had a high learning curve usually can be broken down into steps. You learn until you plateau, experience an impetus that pushes you to grow more, plateau and repeat. This is true for lots of things, it’s just the amount of steps on the Emacs Plateau looks more like a Mayan Temple than a flight of stairs. But thankfully the pareto principle applies to Emacs as well. And if you decide to put some serious time into learning it, Emacs will reward your effort. One of the worst things software can do is waste your time, and I’m happy to say that after 6 years Emacs has never wasted mine.
Emacs also holds a rare position of being a tool primarily developed for software developers, that has found use in the non programmer world. For a program that was never designed for non programmers, this is either a grim reflection of the state of software today, or a glowing endorsement of Emacs.
“I use emacs, which might be thought of as a thermonuclear word processor.”
― Neal Stephenson, In the Beginning...Was the Command Line
In fact, we discovered that the best programming language for that purpose was Lisp. It was Bernie Greenberg, who discovered that it was . He wrote a version of Emacs in Multics MacLisp, and he wrote his commands in MacLisp in a straightforward fashion. The editor itself was written entirely in Lisp. Multics Emacs proved to be a great success—programming new editing commands was so convenient that even the secretaries in his office started learning how to use it. They used a manual someone had written which showed how to extend Emacs, but didn't say it was a programming. So the secretaries, who believed they couldn't do programming, weren't scared off. They read the manual, discovered they could do useful things and they learned to program.
― Richard Stallman My Lisp Experiences and the Development of GNU Emacs
People love using Emacs to write. Once you get proficient in it, it’s so much faster to work with large bodies of text. But the brave authors who’ve jumped in headfirst to wrangle org-mode into something closer to a word processor still have an uphill battle. Awhat you see is what you get (WYSIWYG) style editing mode designed specifically for writing would go a long way to helping this issue. It’s something that everyone wants, even Richard Stallman, who mentioned it as one of his top 5 things he wanted to see in Emacs at Emacsconf 2022. We are part way there, and this should come as no surprise, as Emacs already has an option for printing a buffer.
Finally, Emacs has reached star status with its depiction on the Silver Screen in the movie Tron Legacy. Very few text editors or people for that matter, can say that. I wonder how many people have seen it and didn’t know what is was?
With all these cools Emacs facts I know you must be dying to try it out, and luckily for you there are many ways that you can get it. Here are some of the ways below…
brew cask install emacs
Debian based distribution
sudo apt-get update
sudo apt-get install emacs
Arch based distribution
sudo pacman -Syu
sudo pacman -S emacs
Fedora based distribution
sudo dnf update
sudo dnf install emacs
And if all that I’ve written so far isn’t enough to excite you to give it a try, take a peek these two exciting features soon to be released with Emacs version 29.1
New packages in Emacs Core
Eglot a language server protocol
Treesitter with new tree sitter modes
bash-ts-mode, c++-ts-mode, c-or-c++-ts-mode, c-ts-mode, cmake-ts-mode, csharp-ts-mode, css-ts-mode, dockerfile-ts-mode, go-mod-ts-mode, go-ts-mode, java-ts-mode, js-ts-mode, json-ts-mode, python-ts-mode, ruby-ts-mode, rust-ts-mode toml-ts-mode, tsx-ts-mode typescript-ts-mode, yaml-ts-mode
Not bad for a quadragenarian piece of software who used to be derisively called Eight Megabytes And Constantly Swapping. For those of you who wish to join me on the bleeding Edge, the second pretest of Emacs version 29.1 can be found here. For those who want a more stable experience, version 28.2 is fantastic and includes the work for native Elisp compilation.
As you can see I’m a big fan of Emacs, and maybe I’ve convinced you to give it a try. But even if I haven’t, I hope you leave you with this advice. Build a piece of software that lasts, build a piece of software that can be extended to fit users preferences, and if you can, build a piece of software that doesn’t just make your life, or a programmer’s life easier, but as many people as you can afford to. And if you do that, maybe you will create something that people will love just as much as you do.
Call To Action 📣
If you made it this far thanks for reading! If you are new welcome! I like to talk about technology, niche programming languages, AI, and low-level coding. I’ve recently started a Twitter and would love for you to check it out. I also have a Mastodon if that is more your jam. If you liked the article, consider liking and subscribing. And if you haven’t why not check out another article of mine! Thank you for your valuable time.