Emacs (which stands for "Editor Macros") was originally implemented using a set of macros (go figure) atop the TECO text editor. (Which more or less stands for "Tape Editing Commands." This tells you how long ago it was written...)
TECO is famed for being the most perversely complexly powerful text editor. People have written TECO macros to do odd things such as computing Pi, not because TECO is efficient at the job (it's not, normally) but rather to show that their hacking capabilities are without peer.
It's a really powerful system, but it's really difficult to comprehend how to use that power.
This corresponds closely to DECUS TECO, v40. Full documentation is available.
This is a modern-ish (has been touched since 2015!) version of TECOC that merges some of the ports' code in, renews ability to run on Windows, MacOS, Linux, enables video support on MacOS/Linux