Why Emacs Has Many Keys for Undo (2025)

By Xah Lee. Date: .

Why emacs undo has keys control+/ but also control+_

explain why emacs undo has keys control+/ but also control+_

In Emacs, the undo command (which reverses the most recent change in the buffer) is bound to multiple key combinations by default: C-/ (Control + /), C-_ (Control + _), and also C-x u (Control + X followed by U).

All three invoke the same underlying function, undo, allowing users to choose based on preference or keyboard setup.The primary reason for having both C-/ and C-_ specifically is compatibility across different terminal environments and historical hardware limitations.

On many older text terminals that only support ASCII control characters (limited to Ctrl + A through Ctrl + Z), the key combination C-/ isn't natively representable as a distinct control code.

However, in practice, pressing what users intend as C-/ on such terminals often transmits the same underlying character code (ASCII 31, or octal 037) that Emacs interprets as C-_.

To ensure the undo functionality works reliably regardless of the terminal's behavior—whether it sends the code for C-/ or C-_—Emacs binds both keys to the command.

This dual binding prevents issues where the undo might fail in certain setups, like legacy consoles or specific SSH sessions.Additionally, C-_ can sometimes be easier to type on standard keyboards, as it involves holding Control while pressing Shift + - (the hyphen key, which produces an underscore when shifted).

In contrast, C-/ uses the forward slash key directly with Control.

The extra C-x u binding exists for mnemonic reasons—'u' stands for "undo"—making it more intuitive for beginners or those less familiar with Emacs' control key conventions.These bindings can be customized in your Emacs configuration file (e.g., .emacs or init.el) if needed, but the defaults prioritize broad accessibility.

emacs undo key history 2025-08-10 19b15
emacs undo key history 2025-08-10 19b15

emacs undo topics