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.
teco469.diffs is my patch to the TECO version 4.69 sources which allows them to compile and function on Linux. This must be patched onto Teco 4.69.
This corresponds closely to DECUS TECO, v40. Full documentation is available.
TECO V40 User Guide - Text ... and as PDF