Variable: after-change-functions

after-change-functions is a variable defined in buffer.c.

Value

(viper-undo-sentinel)

Documentation

List of functions to call after each text change.

Three arguments are passed to each function: the positions of the beginning and end of the range of changed text, and the length in chars of the pre-change text replaced by that range.
(For an insertion, the pre-change length is zero;
for a deletion, that length is the number of chars deleted, and the post-change beginning and end are at the same place.)

Buffer changes made while executing the after-change-functions don't call any before-change or after-change functions. That's because inhibit-modification-hooks is temporarily set non-nil.

If an unhandled error happens in running these functions, the variable's value remains nil. That prevents the error from happening repeatedly and making Emacs nonfunctional.

View in manual

Probably introduced at or before Emacs version 19.23.

Source Code

// Defined in /usr/src/emacs/src/buffer.c
  DEFVAR_LISP ("after-change-functions", Vafter_change_functions,
	       doc: /* List of functions to call after each text change.
Three arguments are passed to each function: the positions of
the beginning and end of the range of changed text,
and the length in chars of the pre-change text replaced by that range.
\(For an insertion, the pre-change length is zero;
for a deletion, that length is the number of chars deleted,
and the post-change beginning and end are at the same place.)