Emacs As a 2D CLI

Hongchao Liu has an interesting discussion about viewing Emacs as a two dimensional command line interface. He begins by arguing that Emacs does, in fact, adhere to the Unix principal of doing one thing well. That’s very counterintuitive but Liu says that if you view Emacs’ domain as text, then the one thing that it does well is to wrangle text. That’s not a new idea, of course; I wrote about it back in 2017 in connection with a post from ambrevar. Still, it’s a useful way of thinking about Emacs and its environment.

Liu’s other insight is that if you think about the normal Unix command line interface, it’s really about individual programs that have no knowledge of each other communicating through a text stream and they do this in a programming environment that we call the shell. That environment is inherently one dimension because the flow of data between the programs is basically a line of text.

With that in mind, Emacs can be viewed as a two dimensional command line interface. Rather than dealing with a line of text, Emacs deals with a two dimensional array of lines. In this case, the programming environment is Emacs rather than the shell. Liu uses the example of starting with a Magit commit log, jumping to a diff of the commit, and then to the actual source code of the program. As with the Unix pipeline, none of the programs know about each other and simply perform their work on the two dimensional array of lines that they are passed.

It’s an illuminating point of view and provides a neat answer to those who say Emacs is the anti-Unix. Take a look at Liu’s post. I think you’ll find it interesting.

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