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