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