Variable: pre-command-hook

pre-command-hook is a variable defined in keyboard.c.

Documentation

Normal hook run before each command is executed.

If an unhandled error happens in running this hook, the function in which the error occurred is unconditionally removed, since otherwise the error might happen repeatedly and make Emacs nonfunctional.

Note that, when long-line-optimizations-p is non-nil in the buffer, these functions are called as if they were in a with-restriction form, with a long-line-optimizations-in-command-hooks label and with the buffer narrowed to a portion around point whose size is specified by long-line-optimizations-region-size.

See also post-command-hook.

View in manual

Probably introduced at or before Emacs version 19.20.

Source Code

// Defined in /usr/src/emacs/src/keyboard.c
  DEFVAR_LISP ("pre-command-hook", Vpre_command_hook,
	       doc: /* Normal hook run before each command is executed.

If an unhandled error happens in running this hook, the function in
which the error occurred is unconditionally removed, since otherwise
the error might happen repeatedly and make Emacs nonfunctional.

Note that, when `long-line-optimizations-p' is non-nil in the buffer,
these functions are called as if they were in a `with-restriction' form,
with a `long-line-optimizations-in-command-hooks' label and with the
buffer narrowed to a portion around point whose size is specified by
`long-line-optimizations-region-size'.

See also `post-command-hook'.  */);