Mode hooks exist, whether or not they are predefined variables.
If doc-view-mode
is a major mode then doc-view-mode-hook
is alive and well.
That is to say that the coding conventions call for a major mode to run its mode hook when the mode is turned on. But typically no hook variable is predefined.
The doc for define-derived-mode
tells you that the newly defined mode will run a hook that is constructed by derived-mode-hook-name
, which interns the hook name.
In other words, no such variable is defined ahead of time, but when you enter the mode its symbol is interned and bound to a local variable, which is run as a hook (the functions in its value are invoked).
If there happens to be a global variable of the same name then that variable is bound (dynamically). But there need not be such a global variable.
From Elisp, Major Mode Conventions
:
Each major mode should have a normal "mode hook" named
`MODENAME-mode-hook'. The very last thing the major mode command
should do is to call `run-mode-hooks'. This runs the normal hook
`change-major-mode-after-body-hook', the mode hook, and then the
normal hook `after-change-major-mode-hook'.