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 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 @c We need to xref to where each hook is documented or else document
38 @item activate-mark-hook
41 @item after-change-functions
44 @item after-change-major-mode-hook
50 @item after-insert-file-functions
51 @xref{Format Conversion}.
53 @item after-make-frame-functions
54 @xref{Creating Frames}.
56 @item after-revert-hook
60 @xref{Saving Buffers}.
62 @item auto-fill-function
68 @item before-change-functions
71 @item before-init-hook
74 @item before-make-frame-hook
75 @xref{Creating Frames}.
77 @item before-revert-hook
80 @item before-save-hook
81 @xref{Saving Buffers}.
83 @item blink-paren-function
86 @item buffer-access-fontify-functions
87 @xref{Lazy Properties}.
89 @item calendar-load-hook
91 @inforef{Calendar Customizing,, emacs-xtra}.
94 @xref{Calendar Customizing,,, emacs}.
98 @item change-major-mode-hook
99 @xref{Creating Buffer-Local}.
101 @item command-line-functions
102 @xref{Command-Line Arguments}.
104 @item comment-indent-function
105 @xref{Options for Comments,, Options Controlling Comments, emacs, the
108 @item compilation-finish-functions
109 Functions to call when a compilation process finishes.
111 @item custom-define-hook
112 Hook called after defining each customize option.
114 @item deactivate-mark-hook
117 @item desktop-after-read-hook
118 Normal hook run after a successful @code{desktop-read}. May be used
119 to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs
120 Sessions, emacs, the GNU Emacs Manual}.
122 @item desktop-no-desktop-file-hook
123 Normal hook run when @code{desktop-read} can't find a desktop file.
124 May be used to show a dired buffer. @xref{Saving Emacs Sessions,,
125 Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
127 @item desktop-save-hook
128 Normal hook run before the desktop is saved in a desktop file. This
129 is useful for truncating history lists, for example. @xref{Saving
130 Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
132 @item diary-display-hook
134 @inforef{Fancy Diary Display,, emacs-xtra}.
137 @xref{Fancy Diary Display,,, emacs}.
141 List of functions called after the display of the diary. Can be used
142 for appointment notification.
144 @item disabled-command-function
145 @xref{Disabling Commands}.
147 @item echo-area-clear-hook
148 @xref{Echo Area Customization}.
150 @item emacs-startup-hook
154 @xref{Visiting Functions}.
156 @item find-file-not-found-functions
157 @xref{Visiting Functions}.
159 @item first-change-hook
162 @item font-lock-beginning-of-syntax-function
163 @xref{Syntactic Font Lock}.
165 @item font-lock-fontify-buffer-function
166 @xref{Other Font Lock Variables}.
168 @item font-lock-fontify-region-function
169 @xref{Other Font Lock Variables}.
171 @item font-lock-mark-block-function
172 @xref{Other Font Lock Variables}.
174 @item font-lock-syntactic-face-function
175 @xref{Syntactic Font Lock}.
177 @item font-lock-unfontify-buffer-function
178 @xref{Other Font Lock Variables}.
180 @item font-lock-unfontify-region-function
181 @xref{Other Font Lock Variables}.
183 @item initial-calendar-window-hook
185 @inforef{Calendar Customizing,, emacs-xtra}.
188 @xref{Calendar Customizing,,, emacs}.
191 @item kbd-macro-termination-hook
192 @xref{Keyboard Macros}.
194 @item kill-buffer-hook
195 @xref{Killing Buffers}.
197 @item kill-buffer-query-functions
198 @xref{Killing Buffers}.
200 @item kill-emacs-hook
201 @xref{Killing Emacs}.
203 @item kill-emacs-query-functions
204 @xref{Killing Emacs}.
206 @item lisp-indent-function
208 @item list-diary-entries-hook
210 @inforef{Fancy Diary Display,, emacs-xtra}.
213 @xref{Fancy Diary Display,,, emacs}.
216 @item mail-setup-hook
217 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
220 @item mark-diary-entries-hook
222 @inforef{Fancy Diary Display,, emacs-xtra}.
225 @xref{Fancy Diary Display,,, emacs}.
228 @item menu-bar-update-hook
231 @item minibuffer-setup-hook
232 @xref{Minibuffer Misc}.
234 @item minibuffer-exit-hook
235 @xref{Minibuffer Misc}.
237 @item mouse-position-function
238 @xref{Mouse Position}.
240 @item nongregorian-diary-listing-hook
242 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
245 @xref{Hebrew/Islamic Entries,,, emacs}.
248 @item nongregorian-diary-marking-hook
250 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
253 @xref{Hebrew/Islamic Entries,,, emacs}.
258 @item post-command-hook
259 @xref{Command Overview}.
261 @item pre-abbrev-expand-hook
262 @xref{Abbrev Expansion}.
264 @item pre-command-hook
265 @xref{Command Overview}.
267 @item print-diary-entries-hook
269 @inforef{Diary Customizing,, emacs-xtra}.
272 @xref{Diary Customizing,,, emacs}.
275 @item redisplay-end-trigger-functions
278 @item scheme-indent-function
281 @xref{Suspending Emacs}.
283 @item suspend-resume-hook
284 @xref{Suspending Emacs}.
286 @item temp-buffer-setup-hook
287 @xref{Temporary Displays}.
289 @item temp-buffer-show-function
290 @xref{Temporary Displays}.
292 @item temp-buffer-show-hook
293 @xref{Temporary Displays}.
295 @item term-setup-hook
296 @xref{Terminal-Specific}.
298 @item today-visible-calendar-hook
300 @inforef{Calendar Customizing,, emacs-xtra}.
303 @xref{Calendar Customizing,,, emacs}.
306 @item today-invisible-calendar-hook
308 @inforef{Calendar Customizing,, emacs-xtra}.
311 @xref{Calendar Customizing,,, emacs}.
314 @item window-configuration-change-hook
317 @item window-scroll-functions
320 @item window-setup-hook
321 @xref{Window Systems}.
323 @item window-size-change-functions
326 @item write-contents-functions
327 @xref{Saving Buffers}.
329 @item write-file-functions
330 @xref{Saving Buffers}.
332 @item write-region-annotate-functions
333 @xref{Format Conversion}.
337 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88