Undo support in Neomacs is provided by undo-mode
.
undo-mode
inherits (standard-object)
undo-entry
amalgamate-limit
amalgamate-count
undo
(&optional (buffer (current-buffer)))
undo-entry
.redo
(&optional (branch-index 0) (buffer (current-buffer)))
next-branch
(&optional (buffer (current-buffer)))
previous-branch
(&optional (buffer (current-buffer)))
C-x u
): undo-history
()
active-undo-mode
.q, C-g, enter
): quit-undo-history
()
The primitive record-undo
adds a pair of thunks to the undo history, which are called to undo or redo some changes.
record-undo
(undo-thunk redo-thunk buffer)
*inhibit-record-undo*
is non-nil, do nothing instead.*inhibit-record-undo*
record-undo
has no effect. All editing primitives maintain undo information themselves. Changes to attributes are normally not recorded in undo history, but you can bind *record-attribute-undo*
to t
to make attribute changes undoable.
*record-attribute-undo*
(setf attribute)
, not computed
attributes (set-attribute-function
).Undo commands and the undo-history
buffer both group series of undoable changes and operates on them as a whole. An undo boundary marks the end of previous group and the start of a new one. The command loop inserts an undo boundary before every command invocation, but this can be removed by remove-undo-boundary
, or automatically by undo-auto-amalgamate
.
undo-boundary
(&optional (buffer (current-buffer)))
remove-undo-boundary
(buffer)
undo-auto-amalgamate
()
*this-command*
is the same as
*last-command*
, and if amalgamate-count
will not exceed
amalgamate-limit
.