Emacs Still an Indispensible Text Editor

It has been over 15 years since I first knew of Emacs and started using it as
part of my workflow. Even today, I still very clearly remember the keyboard
shortcuts to navigate in info-mode, as I’ve been spending a great deal of time
in info-mode in the early days when the Internet was not yet as convenient,
available and resource-rich as it is today. These commands are just like muscle
memory, that probably would never ever elude me again.
In the early days, good text editors were a rare species, and there were no Atom, Sublime Text, or VS Code as every developer uses today. Only Emacs and Vim. What hooked me up with Emacs instead of Vim might be its supreme support for the Lisp language, at a time when machine learning just started to rekindle (again), when deep learning wasn’t even a thing, and when people talked about AI, they mostly were referring to expert systems where many were programmed in Lisp.
I later have used Emacs extensively, almost on a daily basis, for a variety of things, including but are not limited to:
- Learning the common lisp language
- Following through the SICP book using MIT Scheme
- Learning the Coq proof assistant in the awesome Software Foundations class by Professor Pierce
- Learning OCaml, Standard ML, and Haskell out of self interest
- Writing a number of theses and dissertations in LaTeX, with the help of AucTeX
- Spinning up Eshell to perform quick commands, which is especially handy on Windows before the days of Windows Terminal
- Using Tramp mode to access remote files
Surprisingly enough, I am doing nearly none of the above things nowadays. While my interests in Lisp, Scheme, OCaml, Haskell, and programming languages in general remain, I am seldomly programming anything in these languages. I have also left LaTeX behind for a while, and if I ever need to use it, Overleaf is fulfilling my need most of the time. I seldom use Eshell now as switching to a handy terminal window is a breeze thanks to iTerm2. Remote access also got much easier, and things I do on remote machines seldomly need fancy Emacs-fu.
So I wonder, why do I have Emacs still on every of my machines? It’s because Emacs still fills many a niche use case of mine–if not on a daily basis–that I don’t have a good substitute, and maybe never will. Here is a brief and incomplete list:
- Filling a paragraph: Not all text editors have this by default, and even if they do, in some of them you may need to move your hands away from the keyboard and reach to the mouse to do it, which is cumbersome. Even more, Emacs supports auto-file mode, so that you actually never worry about filling a paragraph manually.
- Un-filling a paragraph: This is the opposite of filling a paragraph, and I have a custom defined function that I’ve been using ever since.
- Find-replace: Emacs’s query-replace functions are really handy to use. It works with special characters very easily. Its capabilities become much greater when you combine it with regex as well.
- Rectangular text manipulation: So easy to deal with text copied from elsewhere. To make text rectangular, you may for instance first find-replace all spaces into single tabs.
- Batch transformation of texts: What would you do when you want to change many lines of texts in one format into a set of lines of text in an entirely different? Using sed/awk may be one way, but honestly, I’ve never managed to remember the syntax of sed/awk. In Emacs, I’d just record a macro that remembers how I do the desired transformation for one line, using any text editing I find convenient for the transformation, and then apply this macro to the rest of lines. Plus, I can apply this to as many or as few lines I want, and not necessarily for contiguous lines. In contrast, sed/awk would require me to first prepare the text in a file, or console input, and it’s also hard to examine the correctness of my intended transformations.
- Counters: Counters in Emacs is another blessing. My main use case for counters is still in batch text transformation, where each line needs to use a number incremented from previous lines.
- Analyzing logs: When the Atom text editor was the hottest thing, it has big troubles when opening big text files. VS Code was better, but Emacs still wins over it by a big margin when analyzing big log files. There are so many handy text searching / filtering commands inside Emacs that makes navigating through logs just a breeze.
It may be interesting to note that my use cases of Emacs today seem to be very corner ones, and I have not scratched the surface of why most people use it, e.g., writing long articles, using the all-mighty org-mode, as an IDE, and more. But for me, it is just these minor corners that Emacs wins over other text editors by a great margin. How long would Emacs still being installed on my future computers? Perhaps as long as it exists.