2 @c This is part of the GNU Emacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1998, 2001, 2002, 2003, 2004,
4 @c 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5 @c See the file elisp.texi for copying conditions.
6 @setfilename ../info/hooks
7 @node Standard Hooks, Index, Standard Keymaps, Top
8 @appendix Standard Hooks
10 @cindex hook variables, list of
12 The following is a list of hook variables that let you provide
13 functions to be called from within Emacs on suitable occasions.
15 Most of these variables have names ending with @samp{-hook}. They are
16 @dfn{normal hooks}, run by means of @code{run-hooks}. The value of such
17 a hook is a list of functions; the functions are called with no
18 arguments and their values are completely ignored. The recommended way
19 to put a new function on such a hook is to call @code{add-hook}.
20 @xref{Hooks}, for more information about using hooks.
22 Every major mode defines a mode hook named
23 @samp{@var{modename}-mode-hook}. The major mode command runs this
24 normal hook with @code{run-mode-hooks} as the very last thing it does.
25 @xref{Mode Hooks}. Most minor modes have mode hooks too. Mode hooks
26 are omitted in the list below.
28 The variables whose names end in @samp{-hooks} or @samp{-functions} are
29 usually @dfn{abnormal hooks}; their values are lists of functions, but
30 these functions are called in a special way (they are passed arguments,
31 or their values are used). The variables whose names end in
32 @samp{-function} have single functions as their values.
34 A special feature allows you to specify expressions to evaluate if and
35 when a file is loaded (@pxref{Hooks for Loading}). That feature is
36 not exactly a hook, but does a similar job.
38 @c We need to xref to where each hook is documented or else document
42 @item activate-mark-hook
45 @item after-change-functions
48 @item after-change-major-mode-hook
54 @item after-insert-file-functions
55 @xref{Saving Properties}.
57 @item after-make-frame-functions
58 @xref{Creating Frames}.
60 @item after-revert-hook
64 @xref{Saving Buffers}.
66 @item auto-fill-function
72 @item before-change-functions
75 @item before-init-hook
78 @item before-make-frame-hook
79 @xref{Creating Frames}.
81 @item before-revert-hook
84 @item before-save-hook
85 @xref{Saving Buffers}.
87 @item blink-paren-function
90 @item buffer-access-fontify-functions
91 @xref{Lazy Properties}.
93 @item calendar-load-hook
95 @inforef{Calendar Customizing,, emacs-xtra}.
98 @xref{Calendar Customizing,,, emacs}.
102 @item change-major-mode-hook
103 @xref{Creating Buffer-Local}.
105 @item command-line-functions
106 @xref{Command-Line Arguments}.
108 @item comment-indent-function
109 @xref{Options for Comments,, Options Controlling Comments, emacs, the
112 @item compilation-finish-functions
113 Functions to call when a compilation process finishes.
115 @item custom-define-hook
116 Hook called after defining each customize option.
118 @item deactivate-mark-hook
121 @item desktop-after-read-hook
122 Normal hook run after a successful @code{desktop-read}. May be used
123 to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs
124 Sessions, emacs, the GNU Emacs Manual}.
126 @item desktop-no-desktop-file-hook
127 Normal hook run when @code{desktop-read} can't find a desktop file.
128 May be used to show a dired buffer. @xref{Saving Emacs Sessions,,
129 Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
131 @item desktop-save-hook
132 Normal hook run before the desktop is saved in a desktop file. This
133 is useful for truncating history lists, for example. @xref{Saving
134 Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
136 @item diary-display-hook
138 @inforef{Fancy Diary Display,, emacs-xtra}.
141 @xref{Fancy Diary Display,,, emacs}.
145 List of functions called after the display of the diary. Can be used
146 for appointment notification.
148 @item disabled-command-function
149 @xref{Disabling Commands}.
151 @item echo-area-clear-hook
152 @xref{Echo Area Customization}.
154 @item emacs-startup-hook
158 @xref{Visiting Functions}.
160 @item find-file-not-found-functions
161 @xref{Visiting Functions}.
163 @item first-change-hook
166 @item font-lock-beginning-of-syntax-function
167 @xref{Syntactic Font Lock}.
169 @item font-lock-fontify-buffer-function
170 @xref{Other Font Lock Variables}.
172 @item font-lock-fontify-region-function
173 @xref{Other Font Lock Variables}.
175 @item font-lock-mark-block-function
176 @xref{Other Font Lock Variables}.
178 @item font-lock-syntactic-face-function
179 @xref{Syntactic Font Lock}.
181 @item font-lock-unfontify-buffer-function
182 @xref{Other Font Lock Variables}.
184 @item font-lock-unfontify-region-function
185 @xref{Other Font Lock Variables}.
187 @item initial-calendar-window-hook
189 @inforef{Calendar Customizing,, emacs-xtra}.
192 @xref{Calendar Customizing,,, emacs}.
195 @item kbd-macro-termination-hook
196 @xref{Keyboard Macros}.
198 @item kill-buffer-hook
199 @xref{Killing Buffers}.
201 @item kill-buffer-query-functions
202 @xref{Killing Buffers}.
204 @item kill-emacs-hook
205 @xref{Killing Emacs}.
207 @item kill-emacs-query-functions
208 @xref{Killing Emacs}.
210 @item lisp-indent-function
212 @item list-diary-entries-hook
214 @inforef{Fancy Diary Display,, emacs-xtra}.
217 @xref{Fancy Diary Display,,, emacs}.
220 @item mail-setup-hook
221 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
224 @item mark-diary-entries-hook
226 @inforef{Fancy Diary Display,, emacs-xtra}.
229 @xref{Fancy Diary Display,,, emacs}.
232 @item menu-bar-update-hook
235 @item minibuffer-setup-hook
236 @xref{Minibuffer Misc}.
238 @item minibuffer-exit-hook
239 @xref{Minibuffer Misc}.
241 @item mouse-position-function
242 @xref{Mouse Position}.
244 @item nongregorian-diary-listing-hook
246 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
249 @xref{Hebrew/Islamic Entries,,, emacs}.
252 @item nongregorian-diary-marking-hook
254 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
257 @xref{Hebrew/Islamic Entries,,, emacs}.
262 @item post-command-hook
263 @xref{Command Overview}.
265 @item pre-abbrev-expand-hook
266 @xref{Abbrev Expansion}.
268 @item pre-command-hook
269 @xref{Command Overview}.
271 @item print-diary-entries-hook
273 @inforef{Diary Customizing,, emacs-xtra}.
276 @xref{Diary Customizing,,, emacs}.
279 @item redisplay-end-trigger-functions
282 @item scheme-indent-function
285 @xref{Suspending Emacs}.
287 @item suspend-resume-hook
288 @xref{Suspending Emacs}.
290 @item temp-buffer-setup-hook
291 @xref{Temporary Displays}.
293 @item temp-buffer-show-function
294 @xref{Temporary Displays}.
296 @item temp-buffer-show-hook
297 @xref{Temporary Displays}.
299 @item term-setup-hook
300 @xref{Terminal-Specific}.
302 @item today-visible-calendar-hook
304 @inforef{Calendar Customizing,, emacs-xtra}.
307 @xref{Calendar Customizing,,, emacs}.
310 @item today-invisible-calendar-hook
312 @inforef{Calendar Customizing,, emacs-xtra}.
315 @xref{Calendar Customizing,,, emacs}.
318 @item window-configuration-change-hook
321 @item window-scroll-functions
324 @item window-setup-hook
325 @xref{Window Systems}.
327 @item window-size-change-functions
330 @item write-contents-functions
331 @xref{Saving Buffers}.
333 @item write-file-functions
334 @xref{Saving Buffers}.
336 @item write-region-annotate-functions
337 @xref{Saving Properties}.
341 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88