Next: Index, Previous: Standard Keymaps, Up: Top [Contents][Index]
The following is a list of some hook variables that let you provide functions to be called from within Emacs on suitable occasions.
Most of these variables have names ending with ‘-hook’. They are
normal hooks, run by means of run-hooks. The value of such
a hook is a list of functions; the functions are called with no
arguments and their values are completely ignored. The recommended way
to put a new function on such a hook is to call add-hook.
See Hooks, for more information about using hooks.
The variables whose names end in ‘-functions’ are usually abnormal hooks (some old code may also use the deprecated ‘-hooks’ suffix); their values are lists of functions, but these functions are called in a special way (they are passed arguments, or their return values are used). The variables whose names end in ‘-function’ have single functions as their values.
This is not an exhaustive list, it only covers the more general hooks.
For example, every major mode defines a hook named
‘modename-mode-hook’. The major mode command runs this
normal hook with run-mode-hooks as the very last thing it does.
See Mode Hooks. Most minor modes have mode hooks too.
A special feature allows you to specify expressions to evaluate if and when a file is loaded (see Hooks for Loading). That feature is not exactly a hook, but does a similar job.
activate-mark-hookdeactivate-mark-hookSee The Mark.
after-change-functionsbefore-change-functionsfirst-change-hookSee Change Hooks.
after-change-major-mode-hookchange-major-mode-after-body-hookSee Mode Hooks.
after-init-hookbefore-init-hookemacs-startup-hookwindow-setup-hookSee Init File.
after-insert-file-functionswrite-region-annotate-functionswrite-region-post-annotation-functionSee Format Conversion.
after-make-frame-functionsbefore-make-frame-hookSee Creating Frames.
after-save-hookbefore-save-hookwrite-contents-functionswrite-file-functionsSee Saving Buffers.
after-setting-font-hookHook run after a frame’s font changes.
auto-save-hookSee Auto-Saving.
before-hack-local-variables-hookhack-local-variables-hookSee File Local Variables.
buffer-access-fontify-functionsSee Lazy Properties.
buffer-list-update-hookHook run when the buffer list changes (see Buffer List).
buffer-quit-functionFunction to call to “quit” the current buffer.
change-major-mode-hookcommand-line-functionsdelayed-warnings-hookThe command loop runs this soon after post-command-hook (q.v.).
focus-in-hookfocus-out-hookSee Input Focus.
delete-frame-functionsSee Deleting Frames.
delete-terminal-functionsSee Multiple Terminals.
pop-up-frame-functionsplit-window-preferred-functionecho-area-clear-hookfind-file-hookfind-file-not-found-functionsSee Visiting Functions.
font-lock-extend-after-change-region-functionSee Region to Refontify.
font-lock-extend-region-functionsSee Multiline Font Lock.
font-lock-fontify-buffer-functionfont-lock-fontify-region-functionfont-lock-mark-block-functionfont-lock-unfontify-buffer-functionfont-lock-unfontify-region-functionfontification-functionsframe-auto-hide-functionSee Quitting Windows.
kill-buffer-hookkill-buffer-query-functionsSee Killing Buffers.
kill-emacs-hookkill-emacs-query-functionsSee Killing Emacs.
menu-bar-update-hookSee Menu Bar.
minibuffer-setup-hookminibuffer-exit-hookSee Minibuffer Misc.
mouse-leave-buffer-hookHook run when about to switch windows with a mouse command.
mouse-position-functionSee Mouse Position.
post-command-hookpre-command-hookSee Command Overview.
post-gc-hookSee Garbage Collection.
post-self-insert-hooksuspend-hooksuspend-resume-hooksuspend-tty-functionsresume-tty-functionsSee Suspending Emacs.
syntax-begin-functionsyntax-propertize-extend-region-functionssyntax-propertize-functionfont-lock-syntactic-face-functionSee Syntactic Font Lock. See Syntax Properties.
temp-buffer-setup-hooktemp-buffer-show-functiontemp-buffer-show-hookSee Temporary Displays.
tty-setup-hookSee Terminal-Specific.
window-configuration-change-hookwindow-scroll-functionswindow-size-change-functionsSee Window Hooks.
window-text-change-functionsFunctions to call in redisplay when text in the window might change.
Next: Index, Previous: Standard Keymaps, Up: Top [Contents][Index]