Next: , Previous: Standard Keymaps, Up: Top


Appendix I Standard Hooks

The following is a list of 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.

Every major mode defines a mode 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. Mode hooks are omitted in the list below.

The variables whose names end in `-hooks' or `-functions' are usually abnormal hooks; their values are lists of functions, but these functions are called in a special way (they are passed arguments, or their values are used). The variables whose names end in `-function' have single functions as their values.

activate-mark-hook
See The Mark.
after-change-functions
See Change Hooks.
after-change-major-mode-hook
See Mode Hooks.
after-init-hook
See Init File.
after-insert-file-functions
See Saving Properties.
after-make-frame-functions
See Creating Frames.
after-revert-hook
See Reverting.
after-save-hook
See Saving Buffers.
auto-fill-function
See Auto Filling.
auto-save-hook
See Auto-Saving.
before-change-functions
See Change Hooks.
before-init-hook
See Init File.
before-make-frame-hook
See Creating Frames.
before-revert-hook
See Reverting.
before-save-hook
See Saving Buffers.
blink-paren-function
See Blinking.
buffer-access-fontify-functions
See Lazy Properties.
calendar-load-hook
See Calendar Customizing↗.
change-major-mode-hook
See Creating Buffer-Local.
command-line-functions
See Command-Line Arguments.
comment-indent-function
See Options Controlling Comments↗.
compilation-finish-functions
Functions to call when a compilation process finishes.
custom-define-hook
Hook called after defining each customize option.
deactivate-mark-hook
See The Mark.
desktop-after-read-hook
Normal hook run after a successful desktop-read. May be used to show a buffer list. See Saving Emacs Sessions↗.
desktop-no-desktop-file-hook
Normal hook run when desktop-read can't find a desktop file. May be used to show a dired buffer. See Saving Emacs Sessions↗.
desktop-save-hook
Normal hook run before the desktop is saved in a desktop file. This is useful for truncating history lists, for example. See Saving Emacs Sessions↗.
diary-display-hook
See Fancy Diary Display↗.
diary-hook
List of functions called after the display of the diary. Can be used for appointment notification.
disabled-command-function
See Disabling Commands.
echo-area-clear-hook
See Echo Area Customization.
emacs-startup-hook
See Init File.
find-file-hook
See Visiting Functions.
find-file-not-found-functions
See Visiting Functions.
first-change-hook
See Change Hooks.
font-lock-beginning-of-syntax-function
See Syntactic Font Lock.
font-lock-fontify-buffer-function
See Other Font Lock Variables.
font-lock-fontify-region-function
See Other Font Lock Variables.
font-lock-mark-block-function
See Other Font Lock Variables.
font-lock-syntactic-face-function
See Syntactic Font Lock.
font-lock-unfontify-buffer-function
See Other Font Lock Variables.
font-lock-unfontify-region-function
See Other Font Lock Variables.
initial-calendar-window-hook
See Calendar Customizing↗.
kbd-macro-termination-hook
See Keyboard Macros.
kill-buffer-hook
See Killing Buffers.
kill-buffer-query-functions
See Killing Buffers.
kill-emacs-hook
See Killing Emacs.
kill-emacs-query-functions
See Killing Emacs.
lisp-indent-function
list-diary-entries-hook
See Fancy Diary Display↗.
mail-setup-hook
See Mail Mode Miscellany↗.
mark-diary-entries-hook
See Fancy Diary Display↗.
menu-bar-update-hook
See Menu Bar.
minibuffer-setup-hook
See Minibuffer Misc.
minibuffer-exit-hook
See Minibuffer Misc.
mouse-position-function
See Mouse Position.
nongregorian-diary-listing-hook
See Hebrew/Islamic Entries↗.
nongregorian-diary-marking-hook
See Hebrew/Islamic Entries↗.
occur-hook
post-command-hook
See Command Overview.
pre-abbrev-expand-hook
See Abbrev Expansion.
pre-command-hook
See Command Overview.
print-diary-entries-hook
See Diary Customizing↗.
redisplay-end-trigger-functions
See Window Hooks.
scheme-indent-function
suspend-hook
See Suspending Emacs.
suspend-resume-hook
See Suspending Emacs.
temp-buffer-setup-hook
See Temporary Displays.
temp-buffer-show-function
See Temporary Displays.
temp-buffer-show-hook
See Temporary Displays.
term-setup-hook
See Terminal-Specific.
today-visible-calendar-hook
See Calendar Customizing↗.
today-invisible-calendar-hook
See Calendar Customizing↗.
window-configuration-change-hook
See Window Hooks.
window-scroll-functions
See Window Hooks.
window-setup-hook
See Window Systems.
window-size-change-functions
See Window Hooks.
write-contents-functions
See Saving Buffers.
write-file-functions
See Saving Buffers.
write-region-annotate-functions
See Saving Properties.

Xah Signet