Auto-commit of loaddefs files.
[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.
90db9af9 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
90db9af9 25are omitted from the list below.
b8d4c8d0
GM
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
12f381b7
GM
98@item change-major-mode-after-body-hook
99@xref{Mode Hooks}.
100
b8d4c8d0
GM
101@item change-major-mode-hook
102@xref{Creating Buffer-Local}.
103
104@item command-line-functions
105@xref{Command-Line Arguments}.
106
107@item comment-indent-function
108@xref{Options for Comments,, Options Controlling Comments, emacs, the
109GNU Emacs Manual}.
110
111@item compilation-finish-functions
112Functions to call when a compilation process finishes.
113
114@item custom-define-hook
115Hook called after defining each customize option.
116
117@item deactivate-mark-hook
118@xref{The Mark}.
119
0ed8034e
EZ
120@item delete-frame-functions
121Functions to call when Emacs deletes a frame. @xref{Deleting Frames}.
122
123@item delete-terminal-functions
90db9af9 124Functions to call when Emacs deletes a terminal. @xref{Multiple Terminals}.
e799b4f9 125
b8d4c8d0
GM
126@item disabled-command-function
127@xref{Disabling Commands}.
128
129@item echo-area-clear-hook
130@xref{Echo Area Customization}.
131
132@item emacs-startup-hook
133@xref{Init File}.
134
135@item find-file-hook
136@xref{Visiting Functions}.
137
138@item find-file-not-found-functions
139@xref{Visiting Functions}.
140
141@item first-change-hook
142@xref{Change Hooks}.
143
144@item font-lock-beginning-of-syntax-function
145@xref{Syntactic Font Lock}.
146
147@item font-lock-fontify-buffer-function
148@xref{Other Font Lock Variables}.
149
150@item font-lock-fontify-region-function
151@xref{Other Font Lock Variables}.
152
153@item font-lock-mark-block-function
154@xref{Other Font Lock Variables}.
155
156@item font-lock-syntactic-face-function
157@xref{Syntactic Font Lock}.
158
159@item font-lock-unfontify-buffer-function
160@xref{Other Font Lock Variables}.
161
66af33fc
EZ
162@item hack-local-variables-hook
163@xref{File Local Variables}.
164
b8d4c8d0
GM
165@item font-lock-unfontify-region-function
166@xref{Other Font Lock Variables}.
167
b8d4c8d0
GM
168@item kbd-macro-termination-hook
169@xref{Keyboard Macros}.
170
171@item kill-buffer-hook
172@xref{Killing Buffers}.
173
174@item kill-buffer-query-functions
175@xref{Killing Buffers}.
176
177@item kill-emacs-hook
178@xref{Killing Emacs}.
179
180@item kill-emacs-query-functions
181@xref{Killing Emacs}.
182
b8d4c8d0 183@item mail-setup-hook
0fd2c9a3 184@xref{Mail Misc,, Mail Miscellany, emacs, the GNU Emacs Manual}.
b8d4c8d0 185
b8d4c8d0
GM
186@item menu-bar-update-hook
187@xref{Menu Bar}.
188
189@item minibuffer-setup-hook
190@xref{Minibuffer Misc}.
191
192@item minibuffer-exit-hook
193@xref{Minibuffer Misc}.
194
195@item mouse-position-function
196@xref{Mouse Position}.
197
b8d4c8d0
GM
198@item post-command-hook
199@xref{Command Overview}.
200
f58b9822
GM
201@item post-self-insert-hook
202@xref{Keymaps and Minor Modes}.
203
b8d4c8d0
GM
204@item pre-command-hook
205@xref{Command Overview}.
206
b030b3df
GM
207@item prog-mode-hook
208@xref{Basic Major Modes}.
209
490f1197
EZ
210@item resume-tty-functions
211@xref{Suspending Emacs}.
212
b8d4c8d0
GM
213@item suspend-hook
214@xref{Suspending Emacs}.
215
216@item suspend-resume-hook
217@xref{Suspending Emacs}.
490f1197
EZ
218
219@item suspend-tty-functions
220@xref{Suspending Emacs}.
b8d4c8d0
GM
221
222@item temp-buffer-setup-hook
223@xref{Temporary Displays}.
224
225@item temp-buffer-show-function
226@xref{Temporary Displays}.
227
228@item temp-buffer-show-hook
229@xref{Temporary Displays}.
230
231@item term-setup-hook
232@xref{Terminal-Specific}.
233
b8d4c8d0
GM
234@item window-configuration-change-hook
235@xref{Window Hooks}.
236
237@item window-scroll-functions
238@xref{Window Hooks}.
239
240@item window-setup-hook
241@xref{Window Systems}.
242
243@item window-size-change-functions
244@xref{Window Hooks}.
245
246@item write-contents-functions
247@xref{Saving Buffers}.
248
249@item write-file-functions
250@xref{Saving Buffers}.
251
252@item write-region-annotate-functions
253@xref{Format Conversion}.
254@end table