*** empty log message ***
[bpt/emacs.git] / lispref / hooks.texi
CommitLineData
89851a09
RS
1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual.
651f374c 3@c Copyright (C) 1990, 1991, 1992, 1993, 1998, 2002, 2003, 2004,
ceb4c4d3 4@c 2005, 2006 Free Software Foundation, Inc.
89851a09
RS
5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/hooks
bfe721d1 7@node Standard Hooks, Index, Standard Keymaps, Top
89851a09 8@appendix Standard Hooks
25176866
EZ
9@cindex standard hooks
10@cindex hook variables, list of
89851a09 11
5632e6b4 12The following is a list of hook variables that let you provide
177c0ea7 13functions to be called from within Emacs on suitable occasions.
89851a09 14
5632e6b4
RS
15Most 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
dd73b091
RS
17a hook is a list of functions; the functions are called with no
18arguments and their values are completely ignored. The recommended way
19to put a new function on such a hook is to call @code{add-hook}.
20@xref{Hooks}, for more information about using hooks.
89851a09 21
df16f475
LK
22Every major mode defines a mode hook named
23@samp{@var{modename}-mode-hook}. The major mode command runs this
24normal hook with @code{run-mode-hooks} as the very last thing it does.
be051bc0
LT
25@xref{Mode Hooks}. Most minor modes have mode hooks too. Mode hooks
26are omitted in the list below.
df16f475 27
dd73b091
RS
28The variables whose names end in @samp{-hooks} or @samp{-functions} are
29usually @dfn{abnormal hooks}; their values are lists of functions, but
30these functions are called in a special way (they are passed arguments,
475aab0d
CY
31or their values are used). The variables whose names end in
32@samp{-function} have single functions as their values.
89851a09 33
475aab0d
CY
34(In older Emacs versions, some normal hooks had names ending in
35@samp{-hooks} or @samp{-functions}, and some abnormal hooks had names
36ending in @samp{-hook}. We have renamed all of these to conform to
37the above conventions.)
89851a09 38
df16f475
LK
39@c We need to xref to where each hook is documented or else document
40@c it here.
89851a09
RS
41
42@table @code
43@item activate-mark-hook
df16f475
LK
44@xref{The Mark}.
45
72654a3c 46@item after-change-functions
df16f475
LK
47@xref{Change Hooks}.
48
8a4e8a7f 49@item after-change-major-mode-hook
df16f475
LK
50@xref{Mode Hooks}.
51
89851a09 52@item after-init-hook
df16f475
LK
53@xref{Init File}.
54
89851a09 55@item after-insert-file-functions
df16f475
LK
56@xref{Saving Properties}.
57
fa00d3b6 58@item after-make-frame-functions
df16f475
LK
59@xref{Creating Frames}.
60
f9f59935 61@item after-revert-hook
df16f475
LK
62@xref{Reverting}.
63
f9f59935 64@item after-save-hook
df16f475
LK
65@xref{Saving Buffers}.
66
89851a09 67@item auto-fill-function
df16f475
LK
68@xref{Auto Filling}.
69
89851a09 70@item auto-save-hook
df16f475
LK
71@xref{Auto-Saving}.
72
72654a3c 73@item before-change-functions
df16f475
LK
74@xref{Change Hooks}.
75
89851a09 76@item before-init-hook
df16f475
LK
77@xref{Init File}.
78
89851a09 79@item before-make-frame-hook
df16f475
LK
80@xref{Creating Frames}.
81
f9f59935 82@item before-revert-hook
df16f475
LK
83@xref{Reverting}.
84
a0465ec3 85@item before-save-hook
df16f475
LK
86@xref{Saving Buffers}.
87
89851a09 88@item blink-paren-function
df16f475
LK
89@xref{Blinking}.
90
f9f59935 91@item buffer-access-fontify-functions
df16f475
LK
92@xref{Lazy Properties}.
93
89851a09 94@item calendar-load-hook
df16f475
LK
95@inforef{Calendar Customizing,, emacs-xtra}.
96
f9f59935 97@item change-major-mode-hook
df16f475
LK
98@xref{Creating Buffer-Local}.
99
f9f59935 100@item command-line-functions
df16f475
LK
101@xref{Command-Line Arguments}.
102
89851a09 103@item comment-indent-function
df16f475
LK
104@xref{Options for Comments,, Options Controlling Comments, emacs, the
105GNU Emacs Manual}.
106
25176866
EZ
107@item compilation-finish-functions
108Functions to call when a compilation process finishes.
109
b26d003a 110@item custom-define-hook
df16f475
LK
111Hook called after defining each customize option.
112
89851a09 113@item deactivate-mark-hook
df16f475
LK
114@xref{The Mark}.
115
27758c56 116@item desktop-after-read-hook
df16f475
LK
117Normal hook run after a successful @code{desktop-read}. May be used
118to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs
119Sessions, emacs, the GNU Emacs Manual}.
120
27758c56 121@item desktop-no-desktop-file-hook
df16f475
LK
122Normal hook run when @code{desktop-read} can't find a desktop file.
123May be used to show a dired buffer. @xref{Saving Emacs Sessions,,
124Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
125
27758c56 126@item desktop-save-hook
df16f475
LK
127Normal hook run before the desktop is saved in a desktop file. This
128is useful for truncating history lists, for example. @xref{Saving
129Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
130
89851a09 131@item diary-display-hook
df16f475
LK
132@inforef{Fancy Diary Display,, emacs-xtra}.
133
89851a09 134@item diary-hook
df16f475
LK
135List of functions called after the display of the diary. Can be used
136for appointment notification.
137
27e8464d 138@item disabled-command-function
df16f475
LK
139@xref{Disabling Commands}.
140
f9f59935 141@item echo-area-clear-hook
475aab0d 142@xref{Echo Area Customization}.
df16f475
LK
143
144@item emacs-startup-hook
145@xref{Init File}.
146
f2aa473a 147@item find-file-hook
df16f475
LK
148@xref{Visiting Functions}.
149
f2aa473a 150@item find-file-not-found-functions
df16f475
LK
151@xref{Visiting Functions}.
152
89851a09 153@item first-change-hook
df16f475
LK
154@xref{Change Hooks}.
155
5b3a5f9f
LK
156@item font-lock-beginning-of-syntax-function
157@xref{Syntactic Font Lock}.
158
159@item font-lock-fontify-buffer-function
160@xref{Other Font Lock Variables}.
161
162@item font-lock-fontify-region-function
163@xref{Other Font Lock Variables}.
164
165@item font-lock-mark-block-function
166@xref{Other Font Lock Variables}.
167
168@item font-lock-syntactic-face-function
169@xref{Syntactic Font Lock}.
170
171@item font-lock-unfontify-buffer-function
172@xref{Other Font Lock Variables}.
173
174@item font-lock-unfontify-region-function
175@xref{Other Font Lock Variables}.
176
89851a09 177@item initial-calendar-window-hook
df16f475
LK
178@inforef{Calendar Customizing,, emacs-xtra}.
179
42703598 180@item kbd-macro-termination-hook
df16f475
LK
181@xref{Keyboard Macros}.
182
f9f59935 183@item kill-buffer-hook
df16f475
LK
184@xref{Killing Buffers}.
185
89851a09 186@item kill-buffer-query-functions
df16f475
LK
187@xref{Killing Buffers}.
188
f9f59935 189@item kill-emacs-hook
df16f475
LK
190@xref{Killing Emacs}.
191
89851a09 192@item kill-emacs-query-functions
df16f475
LK
193@xref{Killing Emacs}.
194
89851a09 195@item lisp-indent-function
df16f475 196
89851a09 197@item list-diary-entries-hook
df16f475
LK
198@inforef{Fancy Diary Display,, emacs-xtra}.
199
89851a09 200@item mail-setup-hook
df16f475
LK
201@xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
202Manual}.
203
89851a09 204@item mark-diary-entries-hook
df16f475
LK
205@inforef{Fancy Diary Display,, emacs-xtra}.
206
f9f59935 207@item menu-bar-update-hook
df16f475
LK
208@xref{Menu Bar}.
209
89851a09 210@item minibuffer-setup-hook
df16f475
LK
211@xref{Minibuffer Misc}.
212
72654a3c 213@item minibuffer-exit-hook
df16f475
LK
214@xref{Minibuffer Misc}.
215
97dad108 216@item mouse-position-function
df16f475
LK
217@xref{Mouse Position}.
218
89851a09 219@item nongregorian-diary-listing-hook
df16f475
LK
220@inforef{Hebrew/Islamic Entries,, emacs-xtra}.
221
89851a09 222@item nongregorian-diary-marking-hook
df16f475
LK
223@inforef{Hebrew/Islamic Entries,, emacs-xtra}.
224
6c3b04e6
RS
225@item occur-hook
226
89851a09 227@item post-command-hook
df16f475
LK
228@xref{Command Overview}.
229
89851a09 230@item pre-abbrev-expand-hook
df16f475
LK
231@xref{Abbrev Expansion}.
232
89851a09 233@item pre-command-hook
df16f475
LK
234@xref{Command Overview}.
235
89851a09 236@item print-diary-entries-hook
df16f475
LK
237@inforef{Diary Customizing,, emacs-xtra}.
238
f9f59935 239@item redisplay-end-trigger-functions
df16f475
LK
240@xref{Window Hooks}.
241
242@item scheme-indent-function
243
89851a09 244@item suspend-hook
df16f475
LK
245@xref{Suspending Emacs}.
246
89851a09 247@item suspend-resume-hook
df16f475
LK
248@xref{Suspending Emacs}.
249
250@item temp-buffer-setup-hook
251@xref{Temporary Displays}.
252
89851a09 253@item temp-buffer-show-function
df16f475
LK
254@xref{Temporary Displays}.
255
256@item temp-buffer-show-hook
257@xref{Temporary Displays}.
258
89851a09 259@item term-setup-hook
df16f475
LK
260@xref{Terminal-Specific}.
261
89851a09 262@item today-visible-calendar-hook
df16f475
LK
263@inforef{Calendar Customizing,, emacs-xtra}.
264
89851a09 265@item today-invisible-calendar-hook
df16f475
LK
266@inforef{Calendar Customizing,, emacs-xtra}.
267
f9f59935 268@item window-configuration-change-hook
df16f475
LK
269@xref{Window Hooks}.
270
f9f59935 271@item window-scroll-functions
df16f475
LK
272@xref{Window Hooks}.
273
89851a09 274@item window-setup-hook
df16f475
LK
275@xref{Window Systems}.
276
f9f59935 277@item window-size-change-functions
df16f475
LK
278@xref{Window Hooks}.
279
f2aa473a 280@item write-contents-functions
df16f475
LK
281@xref{Saving Buffers}.
282
f2aa473a 283@item write-file-functions
df16f475
LK
284@xref{Saving Buffers}.
285
bfe721d1 286@item write-region-annotate-functions
df16f475 287@xref{Saving Properties}.
89851a09 288@end table
ab5796a9
MB
289
290@ignore
291 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88
292@end ignore