If I was going to reimplement Emacs it wouldn't be with Lisp.
Is there some reason Lisp is superior to any other general-purpose programming language for text editing? I'm skeptical because to my knowledge, Emacs is the only major text editor written in Lisp.
Not specifically superior for text editing, but it has some specific capabilities that make it ideal for making an editing environment. Specifically, it’s great at incremental, dynamic loading of small code snippets. This allows development of Emacs code without having to recompile and restart all the time. In fact, the low-level core of Emacs (buffer manipulation code, regex execution, redisplay, etc.) is all in C. But then those C routines are strung together with Lisp to make up all the high level functionality. Having a dynamic, incremental language is really handy for that. Does it have to be Lisp? No, not necessarily. But Lisp is a great choice.
The Lem editor[0] and LispWorks IDE's[1] are implemented in Common Lisp.
Still, the reason for choosing a language for whatever are always more social and path-dependent than technical (reason 1: initial developer of whatever really likes the language, reason 2: language is seen as hip within some crowd, reason 3 (later in the game): management feels language is safe). Technical reasons for choosing a language typically tend to be post-hoc rationalizations. (I mean, no sane person would choose Javascript for an editor based on technical reasons alone, yet here we are.)
[0] https://lem-project.github.io/ [1] https://www.lispworks.com/products/lispworks.html
It's a product of its time. In the mid 70s when Emacs was originally created, the MIT Lisp Machine Project had already been going for a few years, and Lisp was kind of a big deal at MIT's AI Lab, where it was created. When Stallman started GNU Emacs in '85 or so, he took lots of inspiration from Lisp and those systems.
You can think of Emacs as a kind of software Lisp machine with an emphasis on editing. Although that analogy only works well if you squint or if you don't know a lot about Lisp machines.
As someone who first learned Lisp through Emacs Lisp, I found it fun, well-documented, and powerful. Once you grok the basics of how the system is dynamically glued together, infinitely hackable, and self-documenting it's kind of mind-blowing.
A good reason is that Lisp has almost no syntax. So it can act as a neutral language that is easy to learn for developers from other languages.
>Is there some reason Lisp is superior to any other general-purpose programming language for text editing?
purely for text editing? No. But that's not what distinguishes Emacs, it's famously very mediocre at it. The point of Emacs is to be a fully transparent, inspectable, dynamic and changeable environment. In spirit similar to Smalltalk systems like Pharo. And for that a Lisp is not the only choice but a very good one.
There's very few languages and environments that facilitate jumping into any place, making a change, compiling or evaluating a block of code or treating it as data and continuing seamlessly.
Because it's very easy to generate lisp code. It's meant for metaprogramming
But if you were implementing it in 1976 you would have.
But in 1976 Emacs was implemented in TECO. In 1984 it was implemented in Lisp, because Multics Emacs _or_ EINE/ZWEI (Lisp Machine editors) were using Lisp as an extension language, which apparently has shown itself to be useful.
Lisp calls c in emacs. What would be a better language? The code-as-data, data-as-code paradigm fits nicely imo with everything-is-a-buffer. Things like global namespace, hooks, defadvice, would all feel very wrong in other interpreter, and yet seem to make sense in elisp.
Emacs is like a minecraft of lisp expressions.
This article isn't about reimplementing emacs.
BTW emacs is written in C.