Document Bug#5541.
[bpt/emacs.git] / doc / lispref / hooks.texi
CommitLineData
b8d4c8d0
GM
1@c -*-texinfo-*-
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,
114f9c96 4@c 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
b8d4c8d0 5@c See the file elisp.texi for copying conditions.
6336d8c3 6@setfilename ../../info/hooks
b8d4c8d0
GM
7@node Standard Hooks, Index, Standard Keymaps, Top
8@appendix Standard Hooks
9@cindex standard hooks
10@cindex hook variables, list of
11
12The following is a list of hook variables that let you provide
13functions to be called from within Emacs on suitable occasions.
14
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
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.
21
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.
25@xref{Mode Hooks}. Most minor modes have mode hooks too. Mode hooks
26are omitted in the list below.
27
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,
31or their values are used). The variables whose names end in
32@samp{-function} have single functions as their values.
33
b694135c
RS
34A special feature allows you to specify expressions to evaluate if and
35when a file is loaded (@pxref{Hooks for Loading}). That feature is
36not exactly a hook, but does a similar job.
37
b8d4c8d0
GM
38@c We need to xref to where each hook is documented or else document
39@c it here.
40
41@table @code
ee2d5b5e
CY
42@item abbrev-expand-functions
43@xref{Abbrev Expansion}.
44
b8d4c8d0
GM
45@item activate-mark-hook
46@xref{The Mark}.
47
48@item after-change-functions
49@xref{Change Hooks}.
50
51@item after-change-major-mode-hook
52@xref{Mode Hooks}.
53
54@item after-init-hook
55@xref{Init File}.
56
57@item after-insert-file-functions
58@xref{Format Conversion}.
59
60@item after-make-frame-functions
61@xref{Creating Frames}.
62
63@item after-revert-hook
64@xref{Reverting}.
65
66@item after-save-hook
67@xref{Saving Buffers}.
68
69@item auto-fill-function
70@xref{Auto Filling}.
71
72@item auto-save-hook
73@xref{Auto-Saving}.
74
75@item before-change-functions
76@xref{Change Hooks}.
77
66af33fc
EZ
78@item before-hack-local-variables-hook
79@xref{File Local Variables}.
80
b8d4c8d0
GM
81@item before-init-hook
82@xref{Init File}.
83
84@item before-make-frame-hook
85@xref{Creating Frames}.
86
87@item before-revert-hook
88@xref{Reverting}.
89
90@item before-save-hook
91@xref{Saving Buffers}.
92
93@item blink-paren-function
94@xref{Blinking}.
95
96@item buffer-access-fontify-functions
97@xref{Lazy Properties}.
98
e799b4f9
GM
99@item calendar-initial-window-hook
100@iftex
101@inforef{Calendar Customizing,, emacs-xtra}.
102@end iftex
103@ifnottex
104@xref{Calendar Customizing,,, emacs}.
105@end ifnottex
106
b8d4c8d0
GM
107@item calendar-load-hook
108@iftex
109@inforef{Calendar Customizing,, emacs-xtra}.
110@end iftex
111@ifnottex
112@xref{Calendar Customizing,,, emacs}.
113@end ifnottex
114
3b364136 115@item calendar-today-invisible-hook
e799b4f9
GM
116@iftex
117@inforef{Calendar Customizing,, emacs-xtra}.
118@end iftex
119@ifnottex
120@xref{Calendar Customizing,,, emacs}.
121@end ifnottex
122
3b364136 123@item calendar-today-visible-hook
e799b4f9
GM
124@iftex
125@inforef{Calendar Customizing,, emacs-xtra}.
126@end iftex
127@ifnottex
128@xref{Calendar Customizing,,, emacs}.
129@end ifnottex
130
b8d4c8d0
GM
131@item change-major-mode-hook
132@xref{Creating Buffer-Local}.
133
134@item command-line-functions
135@xref{Command-Line Arguments}.
136
137@item comment-indent-function
138@xref{Options for Comments,, Options Controlling Comments, emacs, the
139GNU Emacs Manual}.
140
141@item compilation-finish-functions
142Functions to call when a compilation process finishes.
143
144@item custom-define-hook
145Hook called after defining each customize option.
146
147@item deactivate-mark-hook
148@xref{The Mark}.
149
0ed8034e
EZ
150@item delete-frame-functions
151Functions to call when Emacs deletes a frame. @xref{Deleting Frames}.
152
153@item delete-terminal-functions
154Functions to call when Emacs deletes a terminal. @xref{Multiple
155Terminals}.
156
b8d4c8d0
GM
157@item desktop-after-read-hook
158Normal hook run after a successful @code{desktop-read}. May be used
159to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs
160Sessions, emacs, the GNU Emacs Manual}.
161
162@item desktop-no-desktop-file-hook
163Normal hook run when @code{desktop-read} can't find a desktop file.
164May be used to show a dired buffer. @xref{Saving Emacs Sessions,,
165Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
166
167@item desktop-save-hook
168Normal hook run before the desktop is saved in a desktop file. This
169is useful for truncating history lists, for example. @xref{Saving
170Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
171
b8d4c8d0
GM
172@item diary-hook
173List of functions called after the display of the diary. Can be used
174for appointment notification.
175
e799b4f9
GM
176@item diary-list-entries-hook
177@iftex
178@inforef{Fancy Diary Display,, emacs-xtra}.
179@end iftex
180@ifnottex
181@xref{Fancy Diary Display,,, emacs}.
182@end ifnottex
183
184@item diary-mark-entries-hook
185@iftex
186@inforef{Fancy Diary Display,, emacs-xtra}.
187@end iftex
188@ifnottex
189@xref{Fancy Diary Display,,, emacs}.
190@end ifnottex
191
192@item diary-nongregorian-listing-hook
193@iftex
194@inforef{Non-Gregorian Diary,, emacs-xtra}.
195@end iftex
196@ifnottex
197@xref{Non-Gregorian Diary,,, emacs}.
198@end ifnottex
199
200@item diary-nongregorian-marking-hook
201@iftex
202@inforef{Non-Gregorian Diary,, emacs-xtra}.
203@end iftex
204@ifnottex
205@xref{Non-Gregorian Diary,,, emacs}.
206@end ifnottex
207
208@item diary-print-entries-hook
209@iftex
210@inforef{Diary Display,, emacs-xtra}.
211@end iftex
212@ifnottex
213@xref{Diary Display,,, emacs}.
214@end ifnottex
215
b8d4c8d0
GM
216@item disabled-command-function
217@xref{Disabling Commands}.
218
219@item echo-area-clear-hook
220@xref{Echo Area Customization}.
221
222@item emacs-startup-hook
223@xref{Init File}.
224
225@item find-file-hook
226@xref{Visiting Functions}.
227
228@item find-file-not-found-functions
229@xref{Visiting Functions}.
230
231@item first-change-hook
232@xref{Change Hooks}.
233
234@item font-lock-beginning-of-syntax-function
235@xref{Syntactic Font Lock}.
236
237@item font-lock-fontify-buffer-function
238@xref{Other Font Lock Variables}.
239
240@item font-lock-fontify-region-function
241@xref{Other Font Lock Variables}.
242
243@item font-lock-mark-block-function
244@xref{Other Font Lock Variables}.
245
246@item font-lock-syntactic-face-function
247@xref{Syntactic Font Lock}.
248
249@item font-lock-unfontify-buffer-function
250@xref{Other Font Lock Variables}.
251
66af33fc
EZ
252@item hack-local-variables-hook
253@xref{File Local Variables}.
254
b8d4c8d0
GM
255@item font-lock-unfontify-region-function
256@xref{Other Font Lock Variables}.
257
b8d4c8d0
GM
258@item kbd-macro-termination-hook
259@xref{Keyboard Macros}.
260
261@item kill-buffer-hook
262@xref{Killing Buffers}.
263
264@item kill-buffer-query-functions
265@xref{Killing Buffers}.
266
267@item kill-emacs-hook
268@xref{Killing Emacs}.
269
270@item kill-emacs-query-functions
271@xref{Killing Emacs}.
272
273@item lisp-indent-function
274
b8d4c8d0
GM
275@item mail-setup-hook
276@xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
277Manual}.
278
b8d4c8d0
GM
279@item menu-bar-update-hook
280@xref{Menu Bar}.
281
282@item minibuffer-setup-hook
283@xref{Minibuffer Misc}.
284
285@item minibuffer-exit-hook
286@xref{Minibuffer Misc}.
287
288@item mouse-position-function
289@xref{Mouse Position}.
290
b8d4c8d0
GM
291@item occur-hook
292
293@item post-command-hook
294@xref{Command Overview}.
295
b8d4c8d0
GM
296@item pre-command-hook
297@xref{Command Overview}.
298
490f1197
EZ
299@item resume-tty-functions
300@xref{Suspending Emacs}.
301
b8d4c8d0
GM
302@item scheme-indent-function
303
304@item suspend-hook
305@xref{Suspending Emacs}.
306
307@item suspend-resume-hook
308@xref{Suspending Emacs}.
490f1197
EZ
309
310@item suspend-tty-functions
311@xref{Suspending Emacs}.
b8d4c8d0
GM
312
313@item temp-buffer-setup-hook
314@xref{Temporary Displays}.
315
316@item temp-buffer-show-function
317@xref{Temporary Displays}.
318
319@item temp-buffer-show-hook
320@xref{Temporary Displays}.
321
322@item term-setup-hook
323@xref{Terminal-Specific}.
324
b8d4c8d0
GM
325@item window-configuration-change-hook
326@xref{Window Hooks}.
327
328@item window-scroll-functions
329@xref{Window Hooks}.
330
331@item window-setup-hook
332@xref{Window Systems}.
333
334@item window-size-change-functions
335@xref{Window Hooks}.
336
337@item write-contents-functions
338@xref{Saving Buffers}.
339
340@item write-file-functions
341@xref{Saving Buffers}.
342
343@item write-region-annotate-functions
344@xref{Format Conversion}.
345@end table
346
347@ignore
348 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88
349@end ignore