Variable: undo-limit

undo-limit is a customizable variable defined in undo.c.

Value

160000

Documentation

Keep no more undo information once it exceeds this size.

This limit is applied when garbage collection happens. When a previous command increases the total undo list size past this value, the earlier commands that came before it are forgotten.

The size is counted as the number of bytes occupied, which includes both saved text and other data.

This variable was added, or its default value changed, in Emacs 27.1.

View in manual

Probably introduced at or before Emacs version 19.1.

Source Code

// Defined in /usr/src/emacs/src/undo.c
  DEFVAR_INT ("undo-limit", undo_limit,
	      doc: /* Keep no more undo information once it exceeds this size.
This limit is applied when garbage collection happens.
When a previous command increases the total undo list size past this
value, the earlier commands that came before it are forgotten.

The size is counted as the number of bytes occupied,
which includes both saved text and other data.  */);