Function: run-hooks

run-hooks is a function defined in eval.c.

Signature

(run-hooks &rest HOOKS)

Documentation

Run each hook in HOOKS.

Each argument should be a symbol, a hook variable. These symbols are processed in the order specified. If a hook symbol has a non-nil value, that value may be a function or a list of functions to be called to run the hook. If the value is a function, it is called with no arguments. If it is a list, the elements are called, in order, with no arguments.

Major modes should not use this function directly to run their mode hook; they should use run-mode-hooks instead.

Do not use make-local-variable to make a hook variable buffer-local. Instead, use add-hook and specify t for the LOCAL argument.

Probably introduced at or before Emacs version 17.

Source Code

// Defined in /usr/src/emacs/src/eval.c
{
  ptrdiff_t i;

  for (i = 0; i < nargs; i++)
    run_hook (args[i]);

  return Qnil;
}