]> code.delx.au - gnu-emacs/blob - doc/lispref/hooks.texi
(Intro to Minibuffers): Remove long-obsolete info
[gnu-emacs] / 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, 2009 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-hack-local-variables-hook
76 @xref{File Local Variables}.
77
78 @item before-init-hook
79 @xref{Init File}.
80
81 @item before-make-frame-hook
82 @xref{Creating Frames}.
83
84 @item before-revert-hook
85 @xref{Reverting}.
86
87 @item before-save-hook
88 @xref{Saving Buffers}.
89
90 @item blink-paren-function
91 @xref{Blinking}.
92
93 @item buffer-access-fontify-functions
94 @xref{Lazy Properties}.
95
96 @item calendar-load-hook
97 @iftex
98 @inforef{Calendar Customizing,, emacs-xtra}.
99 @end iftex
100 @ifnottex
101 @xref{Calendar Customizing,,, emacs}.
102 @end ifnottex
103
104
105 @item change-major-mode-hook
106 @xref{Creating Buffer-Local}.
107
108 @item command-line-functions
109 @xref{Command-Line Arguments}.
110
111 @item comment-indent-function
112 @xref{Options for Comments,, Options Controlling Comments, emacs, the
113 GNU Emacs Manual}.
114
115 @item compilation-finish-functions
116 Functions to call when a compilation process finishes.
117
118 @item custom-define-hook
119 Hook called after defining each customize option.
120
121 @item deactivate-mark-hook
122 @xref{The Mark}.
123
124 @item delete-frame-functions
125 Functions to call when Emacs deletes a frame. @xref{Deleting Frames}.
126
127 @item delete-terminal-functions
128 Functions to call when Emacs deletes a terminal. @xref{Multiple
129 Terminals}.
130
131 @item desktop-after-read-hook
132 Normal hook run after a successful @code{desktop-read}. May be used
133 to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs
134 Sessions, emacs, the GNU Emacs Manual}.
135
136 @item desktop-no-desktop-file-hook
137 Normal hook run when @code{desktop-read} can't find a desktop file.
138 May be used to show a dired buffer. @xref{Saving Emacs Sessions,,
139 Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
140
141 @item desktop-save-hook
142 Normal hook run before the desktop is saved in a desktop file. This
143 is useful for truncating history lists, for example. @xref{Saving
144 Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
145
146 @item diary-display-hook
147 @iftex
148 @inforef{Fancy Diary Display,, emacs-xtra}.
149 @end iftex
150 @ifnottex
151 @xref{Fancy Diary Display,,, emacs}.
152 @end ifnottex
153
154 @item diary-hook
155 List of functions called after the display of the diary. Can be used
156 for appointment notification.
157
158 @item disabled-command-function
159 @xref{Disabling Commands}.
160
161 @item echo-area-clear-hook
162 @xref{Echo Area Customization}.
163
164 @item emacs-startup-hook
165 @xref{Init File}.
166
167 @item find-file-hook
168 @xref{Visiting Functions}.
169
170 @item find-file-not-found-functions
171 @xref{Visiting Functions}.
172
173 @item first-change-hook
174 @xref{Change Hooks}.
175
176 @item font-lock-beginning-of-syntax-function
177 @xref{Syntactic Font Lock}.
178
179 @item font-lock-fontify-buffer-function
180 @xref{Other Font Lock Variables}.
181
182 @item font-lock-fontify-region-function
183 @xref{Other Font Lock Variables}.
184
185 @item font-lock-mark-block-function
186 @xref{Other Font Lock Variables}.
187
188 @item font-lock-syntactic-face-function
189 @xref{Syntactic Font Lock}.
190
191 @item font-lock-unfontify-buffer-function
192 @xref{Other Font Lock Variables}.
193
194 @item hack-local-variables-hook
195 @xref{File Local Variables}.
196
197 @item font-lock-unfontify-region-function
198 @xref{Other Font Lock Variables}.
199
200 @item initial-calendar-window-hook
201 @iftex
202 @inforef{Calendar Customizing,, emacs-xtra}.
203 @end iftex
204 @ifnottex
205 @xref{Calendar Customizing,,, emacs}.
206 @end ifnottex
207
208 @item kbd-macro-termination-hook
209 @xref{Keyboard Macros}.
210
211 @item kill-buffer-hook
212 @xref{Killing Buffers}.
213
214 @item kill-buffer-query-functions
215 @xref{Killing Buffers}.
216
217 @item kill-emacs-hook
218 @xref{Killing Emacs}.
219
220 @item kill-emacs-query-functions
221 @xref{Killing Emacs}.
222
223 @item lisp-indent-function
224
225 @item list-diary-entries-hook
226 @iftex
227 @inforef{Fancy Diary Display,, emacs-xtra}.
228 @end iftex
229 @ifnottex
230 @xref{Fancy Diary Display,,, emacs}.
231 @end ifnottex
232
233 @item mail-setup-hook
234 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
235 Manual}.
236
237 @item mark-diary-entries-hook
238 @iftex
239 @inforef{Fancy Diary Display,, emacs-xtra}.
240 @end iftex
241 @ifnottex
242 @xref{Fancy Diary Display,,, emacs}.
243 @end ifnottex
244
245 @item menu-bar-update-hook
246 @xref{Menu Bar}.
247
248 @item minibuffer-setup-hook
249 @xref{Minibuffer Misc}.
250
251 @item minibuffer-exit-hook
252 @xref{Minibuffer Misc}.
253
254 @item mouse-position-function
255 @xref{Mouse Position}.
256
257 @item nongregorian-diary-listing-hook
258 @iftex
259 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
260 @end iftex
261 @ifnottex
262 @xref{Hebrew/Islamic Entries,,, emacs}.
263 @end ifnottex
264
265 @item nongregorian-diary-marking-hook
266 @iftex
267 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
268 @end iftex
269 @ifnottex
270 @xref{Hebrew/Islamic Entries,,, emacs}.
271 @end ifnottex
272
273 @item occur-hook
274
275 @item post-command-hook
276 @xref{Command Overview}.
277
278 @item pre-abbrev-expand-hook
279 @xref{Abbrev Expansion}.
280
281 @item pre-command-hook
282 @xref{Command Overview}.
283
284 @item print-diary-entries-hook
285 @iftex
286 @inforef{Diary Customizing,, emacs-xtra}.
287 @end iftex
288 @ifnottex
289 @xref{Diary Customizing,,, emacs}.
290 @end ifnottex
291
292 @item redisplay-end-trigger-functions
293 @xref{Window Hooks}.
294
295 @item resume-tty-functions
296 @xref{Suspending Emacs}.
297
298 @item scheme-indent-function
299
300 @item suspend-hook
301 @xref{Suspending Emacs}.
302
303 @item suspend-resume-hook
304 @xref{Suspending Emacs}.
305
306 @item suspend-tty-functions
307 @xref{Suspending Emacs}.
308
309 @item temp-buffer-setup-hook
310 @xref{Temporary Displays}.
311
312 @item temp-buffer-show-function
313 @xref{Temporary Displays}.
314
315 @item temp-buffer-show-hook
316 @xref{Temporary Displays}.
317
318 @item term-setup-hook
319 @xref{Terminal-Specific}.
320
321 @item today-visible-calendar-hook
322 @iftex
323 @inforef{Calendar Customizing,, emacs-xtra}.
324 @end iftex
325 @ifnottex
326 @xref{Calendar Customizing,,, emacs}.
327 @end ifnottex
328
329 @item today-invisible-calendar-hook
330 @iftex
331 @inforef{Calendar Customizing,, emacs-xtra}.
332 @end iftex
333 @ifnottex
334 @xref{Calendar Customizing,,, emacs}.
335 @end ifnottex
336
337 @item window-configuration-change-hook
338 @xref{Window Hooks}.
339
340 @item window-scroll-functions
341 @xref{Window Hooks}.
342
343 @item window-setup-hook
344 @xref{Window Systems}.
345
346 @item window-size-change-functions
347 @xref{Window Hooks}.
348
349 @item write-contents-functions
350 @xref{Saving Buffers}.
351
352 @item write-file-functions
353 @xref{Saving Buffers}.
354
355 @item write-region-annotate-functions
356 @xref{Format Conversion}.
357 @end table
358
359 @ignore
360 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88
361 @end ignore