At the appropriate times, Emacs uses the run-hooks function
and the other functions below to run particular hooks.
This function takes one or more normal hook variable names as arguments, and runs each hook in turn. Each argument should be a symbol that is a normal hook variable. These arguments are processed in the order specified.
If a hook variable has a non-
nilvalue, that value should be a list of functions.run-hookscalls all the functions, one by one, with no arguments.The hook variable's value can also be a single function—either a lambda expression or a symbol with a function definition—which
run-hookscalls. But this usage is obsolete.
This function is the way to run an abnormal hook and always call all of the hook functions. It calls each of the hook functions one by one, passing each of them the arguments args.
This function is the way to run an abnormal hook until one of the hook functions fails. It calls each of the hook functions, passing each of them the arguments args, until some hook function returns
nil. It then stops and returnsnil. If none of the hook functions returnnil, it returns a non-nilvalue.
This function is the way to run an abnormal hook until a hook function succeeds. It calls each of the hook functions, passing each of them the arguments args, until some hook function returns non-
nil. Then it stops, and returns whatever was returned by the last hook function that was called. If all hook functions returnnil, it returnsnilas well.