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.
If this was useful, let others know by an Affero rating